mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
commands/git : returns an error instead of panicing
This commit is contained in:
@ -1421,6 +1421,19 @@ func TestGitCommandRemoveFile(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGitCommandShow(t *testing.T) {
|
||||
gitCmd := newDummyGitCommand()
|
||||
gitCmd.OSCommand.command = func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"show", "--color", "456abcde"}, args)
|
||||
|
||||
return exec.Command("echo")
|
||||
}
|
||||
|
||||
_, err := gitCmd.Show("456abcde")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestGitCommandCheckout(t *testing.T) {
|
||||
type scenario struct {
|
||||
testName string
|
||||
|
Reference in New Issue
Block a user