mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
fix(git): align git commands with posh-git
This commit is contained in:
parent
9ffc16a1c5
commit
f96f7ecc42
|
@ -272,7 +272,7 @@ func (g *git) getStatusColor(defaultValue string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *git) getGitCommandOutput(args ...string) string {
|
func (g *git) getGitCommandOutput(args ...string) string {
|
||||||
args = append([]string{"-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
||||||
val, _ := g.env.runCommand(gitCommand, args...)
|
val, _ := g.env.runCommand(gitCommand, args...)
|
||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ func TestEnabledInWorkingTree(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetGitOutputForCommand(t *testing.T) {
|
func TestGetGitOutputForCommand(t *testing.T) {
|
||||||
args := []string{"-c", "core.quotepath=false", "-c", "color.status=false"}
|
args := []string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}
|
||||||
commandArgs := []string{"symbolic-ref", "--short", "HEAD"}
|
commandArgs := []string{"symbolic-ref", "--short", "HEAD"}
|
||||||
want := "je suis le output"
|
want := "je suis le output"
|
||||||
env := new(MockedEnvironment)
|
env := new(MockedEnvironment)
|
||||||
|
@ -113,7 +113,7 @@ func setupHEADContextEnv(context *detachedContext) *git {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockedEnvironment) mockGitCommand(returnValue string, args ...string) {
|
func (m *MockedEnvironment) mockGitCommand(returnValue string, args ...string) {
|
||||||
args = append([]string{"-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
args = append([]string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...)
|
||||||
m.On("runCommand", "git", args).Return(returnValue, nil)
|
m.On("runCommand", "git", args).Return(returnValue, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ func TestParseGitStatsInvalidLine(t *testing.T) {
|
||||||
|
|
||||||
func bootstrapUpstreamTest(upstream string) *git {
|
func bootstrapUpstreamTest(upstream string) *git {
|
||||||
env := &MockedEnvironment{}
|
env := &MockedEnvironment{}
|
||||||
env.On("runCommand", "git", []string{"-c", "core.quotepath=false", "-c", "color.status=false", "remote", "get-url", "origin"}).Return(upstream, nil)
|
env.On("runCommand", "git", []string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false", "remote", "get-url", "origin"}).Return(upstream, nil)
|
||||||
props := &properties{
|
props := &properties{
|
||||||
values: map[Property]interface{}{
|
values: map[Property]interface{}{
|
||||||
GithubIcon: "GH",
|
GithubIcon: "GH",
|
||||||
|
|
Loading…
Reference in a new issue