1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-28 09:08:41 +02:00

handle error from git log that arises from lack of tracking

This commit is contained in:
Jesse Duffield 2018-08-07 12:49:31 +10:00
parent ba9485ae57
commit 6985e52949

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"strings"
"github.com/jesseduffield/gocui"
)
@ -90,7 +91,10 @@ func handleBranchSelect(g *gocui.Gui, v *gocui.View) error {
}
go func() {
branch := getSelectedBranch(v)
diff, _ := getBranchGraph(branch.Name, branch.BaseBranch)
diff, err := getBranchGraph(branch.Name, branch.BaseBranch)
if err != nil && strings.HasPrefix(diff, "fatal: ambiguous argument") {
diff = "There is no tracking for this branch"
}
renderString(g, "main", diff)
}()
return nil