mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
f8ec5ab3ae
commit
301ca0b7aa
|
@ -146,9 +146,6 @@ func (g *Git) Template() string {
|
|||
}
|
||||
|
||||
func (g *Git) Enabled() bool {
|
||||
statusFormats := g.props.GetKeyValueMap(StatusFormats, map[string]string{})
|
||||
g.Working = &GitStatus{ScmStatus: ScmStatus{Formats: statusFormats}}
|
||||
g.Staging = &GitStatus{ScmStatus: ScmStatus{Formats: statusFormats}}
|
||||
g.User = &User{}
|
||||
|
||||
if !g.shouldDisplay() {
|
||||
|
@ -489,8 +486,9 @@ func (g *Git) setGitStatus() {
|
|||
)
|
||||
// firstly assume that upstream is gone
|
||||
g.UpstreamGone = true
|
||||
g.Working = &GitStatus{}
|
||||
g.Staging = &GitStatus{}
|
||||
statusFormats := g.props.GetKeyValueMap(StatusFormats, map[string]string{})
|
||||
g.Working = &GitStatus{ScmStatus: ScmStatus{Formats: statusFormats}}
|
||||
g.Staging = &GitStatus{ScmStatus: ScmStatus{Formats: statusFormats}}
|
||||
untrackedMode := g.getUntrackedFilesMode()
|
||||
args := []string{"status", untrackedMode, "--branch", "--porcelain=2"}
|
||||
ignoreSubmodulesMode := g.getIgnoreSubmodulesMode()
|
||||
|
|
|
@ -554,6 +554,8 @@ func TestSetGitStatus(t *testing.T) {
|
|||
if tc.ExpectedStaging == nil {
|
||||
tc.ExpectedStaging = &GitStatus{}
|
||||
}
|
||||
tc.ExpectedStaging.Formats = map[string]string{}
|
||||
tc.ExpectedWorking.Formats = map[string]string{}
|
||||
g.setGitStatus()
|
||||
assert.Equal(t, tc.ExpectedStaging, g.Staging, tc.Case)
|
||||
assert.Equal(t, tc.ExpectedWorking, g.Working, tc.Case)
|
||||
|
|
Loading…
Reference in a new issue