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

better upstream tracking and allow renaming a branch

This commit is contained in:
Jesse Duffield
2020-03-17 21:22:07 +11:00
parent 2169b5109f
commit 1be0ff8da7
12 changed files with 222 additions and 146 deletions

View File

@ -22,11 +22,20 @@ func (gui *Gui) refreshStatus(g *gocui.Gui) error {
// contents end up cleared
g.Update(func(*gocui.Gui) error {
v.Clear()
// TODO: base this off of the current branch
state.pushables, state.pullables = gui.GitCommand.GetCurrentBranchUpstreamDifferenceCount()
if err := gui.updateWorkTreeState(); err != nil {
return err
}
status := fmt.Sprintf("↑%s↓%s", state.pushables, state.pullables)
trackColor := color.FgYellow
if state.pushables == "0" && state.pullables == "0" {
trackColor = color.FgGreen
} else if state.pushables == "?" && state.pullables == "?" {
trackColor = color.FgRed
}
status := utils.ColoredString(fmt.Sprintf("↑%s↓%s", state.pushables, state.pullables), trackColor)
branches := gui.State.Branches
if gui.State.WorkingTreeState != "normal" {