summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstk <stk@ableton.com>2023-02-09 18:21:11 +0100
committerstk <stk@ableton.com>2023-02-09 18:21:11 +0100
commit1da762c29567b8868ffe099452a01c6a68739b5d (patch)
tree1118f71c3049de2d6710f2012cd38245cafaddc2
parente357c00d4d17931f04f4941bf5e1af0274f34d68 (diff)
Explicitly pass --no-autosquash when rebasing
This fixes the problem shown in the previous commit.
-rw-r--r--pkg/commands/git_commands/rebase.go2
-rw-r--r--pkg/commands/git_commands/rebase_test.go6
-rw-r--r--pkg/integration/tests/branch/rebase_does_not_autosquash.go2
3 files changed, 4 insertions, 6 deletions
diff --git a/pkg/commands/git_commands/rebase.go b/pkg/commands/git_commands/rebase.go
index 9ab13da3e..a99686220 100644
--- a/pkg/commands/git_commands/rebase.go
+++ b/pkg/commands/git_commands/rebase.go
@@ -129,7 +129,7 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(baseSha string, todo
debug = "TRUE"
}
- cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty %s", baseSha)
+ cmdStr := fmt.Sprintf("git rebase --interactive --autostash --keep-empty --no-autosquash %s", baseSha)
self.Log.WithField("command", cmdStr).Debug("RunCommand")
cmdObj := self.cmd.New(cmdStr)
diff --git a/pkg/commands/git_commands/rebase_test.go b/pkg/commands/git_commands/rebase_test.go
index 1c28c82b0..ed731ed04 100644
--- a/pkg/commands/git_commands/rebase_test.go
+++ b/pkg/commands/git_commands/rebase_test.go
@@ -26,7 +26,7 @@ func TestRebaseRebaseBranch(t *testing.T) {
testName: "successful rebase",
arg: "master",
runner: oscommands.NewFakeRunner(t).
- Expect(`git rebase --interactive --autostash --keep-empty master`, "", nil),
+ Expect(`git rebase --interactive --autostash --keep-empty --no-autosquash master`, "", nil),
test: func(err error) {
assert.NoError(t, err)
},
@@ -35,7 +35,7 @@ func TestRebaseRebaseBranch(t *testing.T) {
testName: "unsuccessful rebase",
arg: "master",
runner: oscommands.NewFakeRunner(t).
- Expect(`git rebase --interactive --autostash --keep-empty master`, "", errors.New("error")),
+ Expect(`git rebase --interactive --autostash --keep-empty --no-autosquash master`, "", errors.New("error")),
test: func(err error) {
assert.Error(t, err)
},
@@ -125,7 +125,7 @@ func TestRebaseDiscardOldFileChanges(t *testing.T) {
commitIndex: 0,
fileName: "test999.txt",
runner: oscommands.NewFakeRunner(t).
- Expect(`git rebase --interactive --autostash --keep-empty abcdef`, "", nil).
+ Expect(`git rebase --interactive --autostash --keep-empty --no-autosquash abcdef`, "", nil).
Expect(`git cat-file -e HEAD^:"test999.txt"`, "", nil).
Expect(`git checkout HEAD^ -- "test999.txt"`, "", nil).
Expect(`git commit --amend --no-edit --allow-empty`, "", nil).
diff --git a/pkg/integration/tests/branch/rebase_does_not_autosquash.go b/pkg/integration/tests/branch/rebase_does_not_autosquash.go
index 34b58e1d8..78c957a13 100644
--- a/pkg/integration/tests/branch/rebase_does_not_autosquash.go
+++ b/pkg/integration/tests/branch/rebase_does_not_autosquash.go
@@ -45,9 +45,7 @@ var RebaseDoesNotAutosquash = NewIntegrationTest(NewIntegrationTestArgs{
Confirm()
t.Views().Commits().Lines(
- /* Expected the fixup to be kept, but it's gone:
Contains("fixup! branch commit"),
- */
Contains("branch commit"),
Contains("master commit"),
Contains("base"),