Skip to content

Commit

Permalink
fix: do not fetch git stash every time
Browse files Browse the repository at this point in the history
relates to #305
  • Loading branch information
JanDeDobbeleer committed Jan 4, 2021
1 parent 82635cd commit a38fe21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/segment_git.go
Expand Up @@ -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()
Expand Down Expand Up @@ -214,7 +214,9 @@ func (g *git) setGitStatus() {
}
}
g.repo.HEAD = g.getGitHEADContext(status["local"])
g.repo.stashCount = g.getStashContext()
if g.props.getBool(DisplayStashCount, false) {
g.repo.stashCount = g.getStashContext()
}
}

func (g *git) SetStatusColor() {
Expand Down

0 comments on commit a38fe21

Please sign in to comment.