diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-17 21:22:07 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-18 21:29:06 +1100 |
commit | 1be0ff8da738c706e1aff8111428b36a5efced44 (patch) | |
tree | 3f4b90cea75e3803fa0799f76c8e57e34c8cbbeb /pkg/gui/status_panel.go | |
parent | 2169b5109f508a28848ced699f698ca3e4ed2c49 (diff) |
better upstream tracking and allow renaming a branch
Diffstat (limited to 'pkg/gui/status_panel.go')
-rw-r--r-- | pkg/gui/status_panel.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/gui/status_panel.go b/pkg/gui/status_panel.go index 4c69e9b30..d7561d9d7 100644 --- a/pkg/gui/status_panel.go +++ b/pkg/gui/status_panel.go @@ -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" { |