summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-08-14 18:30:06 +1000
committerJesse Duffield <jessedduffield@gmail.com>2018-08-14 18:30:06 +1000
commitbde6182c949918964612b14c0957b7683d9f98bd (patch)
tree2198e2eb97bb394d908c604e50031a3d680ed554 /pkg
parentefb049cd2444c4c08e85404f1d1e0b507daa83ab (diff)
better git squash logic
Diffstat (limited to 'pkg')
-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,