fix(git): initialize status prior to bare repo check

resolves #4330
This commit is contained in:
Jan De Dobbeleer 2023-10-12 18:40:14 +02:00 committed by Jan De Dobbeleer
parent 1c24745e58
commit 82be7a507a

View file

@ -167,6 +167,9 @@ func (g *Git) Enabled() bool {
g.RepoName = platform.Base(g.env, g.convertToLinuxPath(g.realDir))
g.Working = &GitStatus{}
g.Staging = &GitStatus{}
if g.IsBare {
g.getBareRepoInfo()
return true
@ -186,8 +189,6 @@ func (g *Git) Enabled() bool {
g.setBranchStatus()
} else {
g.setPrettyHEADName()
g.Working = &GitStatus{}
g.Staging = &GitStatus{}
}
if g.props.GetBool(FetchUpstreamIcon, false) {
g.UpstreamIcon = g.getUpstreamIcon()