mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-24 05:36:19 +02:00
26 lines
777 B
Go
26 lines
777 B
Go
package commands
|
|
|
|
import (
|
|
"io"
|
|
"io/ioutil"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/commands/git_config"
|
|
"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 &GitCommand{
|
|
Common: utils.NewDummyCommon(),
|
|
OSCommand: osCommand,
|
|
GitConfig: git_config.NewFakeGitConfig(map[string]string{}),
|
|
GetCmdWriter: func() io.Writer { return ioutil.Discard },
|
|
}
|
|
}
|