fix incorrect checked out branch display

This commit is contained in:
Jesse Duffield 2018-08-07 00:41:59 +10:00
parent 9e5c04d57d
commit 694b192b74

View file

@ -183,6 +183,9 @@ func getGitBranches() []Branch {
for i, line := range branchLines { for i, line := range branchLines {
branches = append(branches, branchFromLine(line, i)) branches = append(branches, branchFromLine(line, i))
} }
} else {
// TODO: DRY this up
branches = append(branches, branchFromLine(gitCurrentBranchName(), 0))
} }
branches = getAndMergeFetchedBranches(branches) branches = getAndMergeFetchedBranches(branches)
return branches return branches
@ -525,7 +528,7 @@ func gitCurrentBranchName() string {
if err != nil { if err != nil {
return "" return ""
} }
return branchName return strings.TrimSpace(branchName)
} }
const getBranchesCommand = `set -e const getBranchesCommand = `set -e