1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

ensure current branch is on top of the branch list

This commit is contained in:
Jesse Duffield
2018-08-07 19:26:47 +10:00
parent c8bacb4186
commit 2b37c9b19c

View File

@ -541,6 +541,9 @@ func getGitBranches() []Branch {
return []Branch{constructBranch("", gitCurrentBranchName(), 0)} return []Branch{constructBranch("", gitCurrentBranchName(), 0)}
} }
branches := getBranches() branches := getBranches()
if len(branches) == 0 {
branches = append(branches, constructBranch("", gitCurrentBranchName(), 0))
}
branches = getAndMergeFetchedBranches(branches) branches = getAndMergeFetchedBranches(branches)
return branches return branches
} }