2019-03-02 04:08:09 +02:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
2020-09-29 11:10:57 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
|
2019-03-02 04:08:09 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/i18n"
|
2020-09-29 11:10:57 +02:00
|
|
|
"github.com/jesseduffield/lazygit/pkg/utils"
|
2019-03-02 04:08:09 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// NewDummyGitCommand creates a new dummy GitCommand for testing
|
|
|
|
func NewDummyGitCommand() *GitCommand {
|
2020-09-29 11:10:57 +02:00
|
|
|
return NewDummyGitCommandWithOSCommand(oscommands.NewDummyOSCommand())
|
2019-03-02 04:08:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewDummyGitCommandWithOSCommand creates a new dummy GitCommand for testing
|
2020-09-29 11:10:57 +02:00
|
|
|
func NewDummyGitCommandWithOSCommand(osCommand *oscommands.OSCommand) *GitCommand {
|
2019-03-02 04:08:09 +02:00
|
|
|
return &GitCommand{
|
2020-09-29 11:10:57 +02:00
|
|
|
Log: utils.NewDummyLog(),
|
2019-03-02 04:08:09 +02:00
|
|
|
OSCommand: osCommand,
|
2020-10-04 02:00:48 +02:00
|
|
|
Tr: i18n.NewTranslationSet(utils.NewDummyLog()),
|
2020-09-29 11:10:57 +02:00
|
|
|
Config: config.NewDummyAppConfig(),
|
2019-03-02 04:08:09 +02:00
|
|
|
getGlobalGitConfig: func(string) (string, error) { return "", nil },
|
|
|
|
getLocalGitConfig: func(string) (string, error) { return "", nil },
|
|
|
|
removeFile: func(string) error { return nil },
|
|
|
|
}
|
|
|
|
}
|