summaryrefslogtreecommitdiffstats
path: root/pkg/commands/dummies.go
blob: 38982b93ae020719d157d4fa9134e8cac8895802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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)
}