fix: do not fetch git stash every time

relates to #305
This commit is contained in:
Jan De Dobbeleer 2021-01-04 18:44:22 +01:00 committed by Jan De Dobbeleer
parent 82635cd5ec
commit a38fe214c3

View file

@ -163,7 +163,7 @@ func (g *git) string() string {
if g.repo.working.changed {
fmt.Fprint(buffer, g.getStatusDetailString(g.repo.working, WorkingColor, LocalWorkingIcon, " \uF044"))
}
if g.props.getBool(DisplayStashCount, false) && g.repo.stashCount != "" {
if g.repo.stashCount != "" {
fmt.Fprintf(buffer, " %s%s", g.props.getString(StashCountIcon, "\uF692 "), g.repo.stashCount)
}
return buffer.String()
@ -214,8 +214,10 @@ func (g *git) setGitStatus() {
}
}
g.repo.HEAD = g.getGitHEADContext(status["local"])
if g.props.getBool(DisplayStashCount, false) {
g.repo.stashCount = g.getStashContext()
}
}
func (g *git) SetStatusColor() {
if g.props.getBool(ColorBackground, true) {