summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pkg/commands/git.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 6523dd747..e7a5212a2 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -278,7 +278,12 @@ func (c *GitCommand) Push(branchName string) error {
// retaining the message of the higher commit
func (c *GitCommand) SquashPreviousTwoCommits(message string) error {
// TODO: test this
- return c.OSCommand.RunCommand("git reset --soft HEAD^ && git commit --amend -m " + c.OSCommand.Quote(message))
+ err := c.OSCommand.RunCommand("git reset --soft HEAD^")
+ if err != nil {
+ return err
+ }
+ // TODO: if password is required, we need to return a subprocess
+ return c.OSCommand.RunCommand("git commit --amend -m " + c.OSCommand.Quote(message))
}
// SquashFixupCommit squashes a 'FIXUP' commit into the commit beneath it,