mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
revert: fetch info from the working directory
This reverts commit cb17bb914a
.
This commit is contained in:
parent
1866adfb88
commit
ae9fb25db6
|
@ -292,7 +292,7 @@ func (g *git) getGitCommand() string {
|
|||
}
|
||||
|
||||
func (g *git) getGitCommandOutput(args ...string) string {
|
||||
args = append([]string{"-C", strings.TrimSuffix(g.gitRootFolder, ".git"), "--no-optional-locks", "-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(g.getGitCommand(), args...)
|
||||
return val
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ func TestEnabledInWorkingTree(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestGetGitOutputForCommand(t *testing.T) {
|
||||
args := []string{"-C", "test", "--no-optional-locks", "-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"}
|
||||
want := "je suis le output"
|
||||
env := new(MockedEnvironment)
|
||||
|
@ -69,7 +69,6 @@ func TestGetGitOutputForCommand(t *testing.T) {
|
|||
env.On("getRuntimeGOOS", nil).Return("unix")
|
||||
g := &git{
|
||||
env: env,
|
||||
gitRootFolder: "test",
|
||||
}
|
||||
got := g.getGitCommandOutput(commandArgs...)
|
||||
assert.Equal(t, want, got)
|
||||
|
@ -138,7 +137,7 @@ func setupHEADContextEnv(context *detachedContext) *git {
|
|||
}
|
||||
|
||||
func (m *MockedEnvironment) mockGitCommand(returnValue string, args ...string) {
|
||||
args = append([]string{"-C", "", "--no-optional-locks", "-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)
|
||||
}
|
||||
|
||||
|
@ -551,7 +550,7 @@ func TestGitUpstream(t *testing.T) {
|
|||
for _, tc := range cases {
|
||||
env := &MockedEnvironment{}
|
||||
env.On("isWsl", nil).Return(false)
|
||||
env.On("runCommand", "git", []string{"-C", "", "--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false", "remote", "get-url", "origin"}).Return(tc.Upstream, nil) //nolint:lll
|
||||
env.On("runCommand", "git", []string{"--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false", "remote", "get-url", "origin"}).Return(tc.Upstream, nil)
|
||||
env.On("getRuntimeGOOS", nil).Return("unix")
|
||||
props := &properties{
|
||||
values: map[Property]interface{}{
|
||||
|
|
Loading…
Reference in a new issue