mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-23 00:39:13 +02:00
Merge pull request #3 from jesseduffield/master
Updated to latest master
This commit is contained in:
@ -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: " *"}
|
||||||
}
|
}
|
||||||
@ -141,7 +144,7 @@ func branchInfoFromLine(line string) (string, string, string) {
|
|||||||
r := regexp.MustCompile("\\|.*\\s")
|
r := regexp.MustCompile("\\|.*\\s")
|
||||||
line = r.ReplaceAllString(line, " ")
|
line = r.ReplaceAllString(line, " ")
|
||||||
words := strings.Split(line, " ")
|
words := strings.Split(line, " ")
|
||||||
return words[0], words[1], words[3]
|
return words[0], words[1], words[len(words)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
func abbreviatedTimeUnit(timeUnit string) string {
|
func abbreviatedTimeUnit(timeUnit string) string {
|
||||||
|
Reference in New Issue
Block a user