From 2b37c9b19c8f55c56985961db18ae83c540001d0 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 7 Aug 2018 19:26:47 +1000 Subject: [PATCH] ensure current branch is on top of the branch list --- gitcommands.go | 3 +++ 1 file changed, 3 insertions(+) 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 }