mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-30 09:16:47 +02:00
try rev-parse of git symbolic-ref returns nothing
This commit is contained in:
parent
652237d48f
commit
922f4ed5a4
@ -39,7 +39,10 @@ func (b *BranchListBuilder) obtainCurrentBranch() commands.Branch {
|
|||||||
// even though you're on 'master'
|
// even though you're on 'master'
|
||||||
branchName, err := b.GitCommand.OSCommand.RunCommandWithOutput("git symbolic-ref --short HEAD")
|
branchName, err := b.GitCommand.OSCommand.RunCommandWithOutput("git symbolic-ref --short HEAD")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err.Error())
|
branchName, err = b.GitCommand.OSCommand.RunCommandWithOutput("git rev-parse --short HEAD")
|
||||||
|
if err != nil {
|
||||||
|
panic(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return commands.Branch{Name: strings.TrimSpace(branchName), Recency: " *"}
|
return commands.Branch{Name: strings.TrimSpace(branchName), Recency: " *"}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user