diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-07 19:26:47 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-07 19:26:47 +1000 |
commit | 2b37c9b19c8f55c56985961db18ae83c540001d0 (patch) | |
tree | 0f714c0013309d4ff508a7e14d460f38cbe076dc /gitcommands.go | |
parent | c8bacb418637ec5585ac3c3dace78abf5d9a02bb (diff) |
ensure current branch is on top of the branch list
Diffstat (limited to 'gitcommands.go')
-rw-r--r-- | gitcommands.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gitcommands.go b/gitcommands.go index 4e6b043ed..774a821f1 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -541,6 +541,9 @@ func getGitBranches() []Branch { return []Branch{constructBranch("", gitCurrentBranchName(), 0)} } branches := getBranches() + if len(branches) == 0 { + branches = append(branches, constructBranch("", gitCurrentBranchName(), 0)) + } branches = getAndMergeFetchedBranches(branches) return branches } |