diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 18:30:06 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2018-08-14 18:30:06 +1000 |
commit | bde6182c949918964612b14c0957b7683d9f98bd (patch) | |
tree | 2198e2eb97bb394d908c604e50031a3d680ed554 /pkg/commands/git.go | |
parent | efb049cd2444c4c08e85404f1d1e0b507daa83ab (diff) |
better git squash logic
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 7 |
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, |