mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-08 23:56:15 +02:00
Merge pull request #2271 from jesseduffield/less-pollution-in-tests
This commit is contained in:
commit
2ddd3ddfc0
@ -1,6 +1,8 @@
|
|||||||
package git_commands
|
package git_commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/go-errors/errors"
|
"github.com/go-errors/errors"
|
||||||
gogit "github.com/jesseduffield/go-git/v5"
|
gogit "github.com/jesseduffield/go-git/v5"
|
||||||
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
||||||
@ -70,6 +72,7 @@ func buildGitCommon(deps commonDeps) *GitCommon {
|
|||||||
GetenvFn: getenv,
|
GetenvFn: getenv,
|
||||||
Cmd: cmd,
|
Cmd: cmd,
|
||||||
RemoveFileFn: removeFile,
|
RemoveFileFn: removeFile,
|
||||||
|
TempDir: os.TempDir(),
|
||||||
})
|
})
|
||||||
|
|
||||||
gitCommon.dotGitDir = deps.dotGitDir
|
gitCommon.dotGitDir = deps.dotGitDir
|
||||||
|
@ -19,6 +19,7 @@ type OSCommandDeps struct {
|
|||||||
GetenvFn func(string) string
|
GetenvFn func(string) string
|
||||||
RemoveFileFn func(string) error
|
RemoveFileFn func(string) error
|
||||||
Cmd *CmdObjBuilder
|
Cmd *CmdObjBuilder
|
||||||
|
TempDir string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
|
func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
|
||||||
@ -38,6 +39,7 @@ func NewDummyOSCommandWithDeps(deps OSCommandDeps) *OSCommand {
|
|||||||
getenvFn: deps.GetenvFn,
|
getenvFn: deps.GetenvFn,
|
||||||
removeFileFn: deps.RemoveFileFn,
|
removeFileFn: deps.RemoveFileFn,
|
||||||
guiIO: NewNullGuiIO(utils.NewDummyLog()),
|
guiIO: NewNullGuiIO(utils.NewDummyLog()),
|
||||||
|
tempDir: deps.TempDir,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user