From 694b192b7452c98aafa523ab7ba4dc8f5abecdd2 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 7 Aug 2018 00:41:59 +1000 Subject: fix incorrect checked out branch display --- gitcommands.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gitcommands.go') diff --git a/gitcommands.go b/gitcommands.go index bf1a90026..80bbef860 100644 --- a/gitcommands.go +++ b/gitcommands.go @@ -183,6 +183,9 @@ func getGitBranches() []Branch { for i, line := range branchLines { branches = append(branches, branchFromLine(line, i)) } + } else { + // TODO: DRY this up + branches = append(branches, branchFromLine(gitCurrentBranchName(), 0)) } branches = getAndMergeFetchedBranches(branches) return branches @@ -525,7 +528,7 @@ func gitCurrentBranchName() string { if err != nil { return "" } - return branchName + return strings.TrimSpace(branchName) } const getBranchesCommand = `set -e -- cgit v1.2.3