1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-06 03:53:59 +02:00
lazygit/pkg/commands/dummies.go
Jesse Duffield 007235df23 refactor
2022-01-09 14:09:53 +11:00

29 lines
795 B
Go

package commands
import (
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/jesseduffield/lazygit/pkg/utils"
)
// NewDummyGitCommand creates a new dummy GitCommand for testing
func NewDummyGitCommand() *GitCommand {
return NewDummyGitCommandWithOSCommand(oscommands.NewDummyOSCommand())
}
// NewDummyGitCommandWithOSCommand creates a new dummy GitCommand for testing
func NewDummyGitCommandWithOSCommand(osCommand *oscommands.OSCommand) *GitCommand {
return NewGitCommandAux(
utils.NewDummyCommon(),
osCommand,
utils.NewDummyGitConfig(),
".git",
nil,
)
}
func NewDummyGitCommandWithRunner(runner *oscommands.FakeCmdObjRunner) *GitCommand {
osCommand := oscommands.NewDummyOSCommandWithRunner(runner)
return NewDummyGitCommandWithOSCommand(osCommand)
}