mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Fix the CurrentBranchName function
The function would return "head/branchname" when there was either a tag or a remote with the same name. While fixing this we slightly change the semantic of the function (and of determineCheckedOutBranchName, which calls it): for a detached head it now returns an empty string rather than the commit hash. I actually think this is better.
This commit is contained in:
@ -308,7 +308,7 @@ func (self *RefreshHelper) determineCheckedOutBranchName() string {
|
||||
// In all other cases, get the branch name by asking git what branch is
|
||||
// checked out. Note that if we're on a detached head (for reasons other
|
||||
// than rebasing or bisecting, i.e. it was explicitly checked out), then
|
||||
// this will return its hash.
|
||||
// this will return an empty string.
|
||||
if branchName, err := self.c.Git().Branch.CurrentBranchName(); err == nil {
|
||||
return branchName
|
||||
}
|
||||
|
Reference in New Issue
Block a user