From 114cda474a74bd509ae89dc7350508b7d9b7241f Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Mon, 8 Nov 2021 18:55:21 +0100 Subject: [PATCH] fix(git): fetch detailed information when enabled --- src/segment_git.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/segment_git.go b/src/segment_git.go index 49732a87..19b91ece 100644 --- a/src/segment_git.go +++ b/src/segment_git.go @@ -197,6 +197,11 @@ func (g *git) string() string { if g.Repo.Upstream != "" && g.props.getBool(DisplayUpstreamIcon, false) { g.Repo.UpstreamIcon = g.getUpstreamIcon() } + if g.getBool(FetchStashCount, DisplayStashCount, false) { + g.Repo.StashCount = g.getStashContext() + } + if g.getBool(FetchWorktreeCount, DisplayWorktreeCount, false) { + g.Repo.WorktreeCount = g.getWorktreeContext() } // use template if available segmentTemplate := g.props.getString(SegmentTemplate, "") @@ -277,12 +282,7 @@ func (g *git) setGitStatus() { } } g.Repo.HEAD = g.getGitHEADContext(status["local"]) - if g.getBool(FetchStashCount, DisplayStashCount, false) { - g.Repo.StashCount = g.getStashContext() - } - if g.getBool(FetchWorktreeCount, DisplayWorktreeCount, false) { - g.Repo.WorktreeCount = g.getWorktreeContext() - } + g.Repo.BranchStatus = g.getBranchStatus() } func (g *git) getGitCommand() string {