mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix: untracked is working area only
This commit is contained in:
parent
c41866171d
commit
36b58abdf3
|
@ -316,7 +316,9 @@ func (g *git) parseGitStats(output []string, working bool) *gitStatus {
|
||||||
}
|
}
|
||||||
switch code {
|
switch code {
|
||||||
case "?":
|
case "?":
|
||||||
status.untracked++
|
if working {
|
||||||
|
status.untracked++
|
||||||
|
}
|
||||||
case "D":
|
case "D":
|
||||||
status.deleted++
|
status.deleted++
|
||||||
case "A":
|
case "A":
|
||||||
|
|
|
@ -330,7 +330,7 @@ func TestParseGitStatsStaging(t *testing.T) {
|
||||||
assert.Equal(t, 0, status.unmerged)
|
assert.Equal(t, 0, status.unmerged)
|
||||||
assert.Equal(t, 1, status.added)
|
assert.Equal(t, 1, status.added)
|
||||||
assert.Equal(t, 2, status.deleted)
|
assert.Equal(t, 2, status.deleted)
|
||||||
assert.Equal(t, 1, status.untracked)
|
assert.Equal(t, 0, status.untracked)
|
||||||
assert.True(t, status.changed)
|
assert.True(t, status.changed)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue