summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDaniele D'Orazio <d.dorazio96@gmail.com>2018-09-01 12:29:43 +0200
committerDaniele D'Orazio <d.dorazio96@gmail.com>2018-09-01 12:29:43 +0200
commit39f065207eb8cc0efe4abe511668749a22aafc79 (patch)
tree3eed6b5f78b389a1e1190f7666b6b6631d78b017 /pkg
parent9e6a4a529af999b7c6b2adefe16632f2e19c5b8a (diff)
add simple test for PrepareCommitAmendSubProcess
Diffstat (limited to 'pkg')
-rw-r--r--pkg/commands/git_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go
index 8117ed1e5..fb3bafe6c 100644
--- a/pkg/commands/git_test.go
+++ b/pkg/commands/git_test.go
@@ -189,6 +189,19 @@ func TestGitCommandStashSave(t *testing.T) {
assert.NoError(t, gitCmd.StashSave("A stash message"))
}
+func TestGitCommandCommitAmend(t *testing.T) {
+ gitCmd := newDummyGitCommand()
+ gitCmd.OSCommand.command = func(cmd string, args ...string) *exec.Cmd {
+ assert.EqualValues(t, "git", cmd)
+ assert.EqualValues(t, []string{"commit", "--amend", "--allow-empty"}, args)
+
+ return exec.Command("echo")
+ }
+
+ _, err := gitCmd.PrepareCommitAmendSubProcess().CombinedOutput()
+ assert.NoError(t, err)
+}
+
func TestGitCommandMergeStatusFiles(t *testing.T) {
type scenario struct {
oldFiles []File