mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Explicitly pass --no-autosquash when rebasing
This fixes the problem shown in the previous commit.
This commit is contained in:
		| @@ -129,7 +129,7 @@ func (self *RebaseCommands) PrepareInteractiveRebaseCommand(baseSha string, todo | |||||||
| 		debug = "TRUE" | 		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") | 	self.Log.WithField("command", cmdStr).Debug("RunCommand") | ||||||
|  |  | ||||||
| 	cmdObj := self.cmd.New(cmdStr) | 	cmdObj := self.cmd.New(cmdStr) | ||||||
|   | |||||||
| @@ -26,7 +26,7 @@ func TestRebaseRebaseBranch(t *testing.T) { | |||||||
| 			testName: "successful rebase", | 			testName: "successful rebase", | ||||||
| 			arg:      "master", | 			arg:      "master", | ||||||
| 			runner: oscommands.NewFakeRunner(t). | 			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) { | 			test: func(err error) { | ||||||
| 				assert.NoError(t, err) | 				assert.NoError(t, err) | ||||||
| 			}, | 			}, | ||||||
| @@ -35,7 +35,7 @@ func TestRebaseRebaseBranch(t *testing.T) { | |||||||
| 			testName: "unsuccessful rebase", | 			testName: "unsuccessful rebase", | ||||||
| 			arg:      "master", | 			arg:      "master", | ||||||
| 			runner: oscommands.NewFakeRunner(t). | 			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) { | 			test: func(err error) { | ||||||
| 				assert.Error(t, err) | 				assert.Error(t, err) | ||||||
| 			}, | 			}, | ||||||
| @@ -125,7 +125,7 @@ func TestRebaseDiscardOldFileChanges(t *testing.T) { | |||||||
| 			commitIndex: 0, | 			commitIndex: 0, | ||||||
| 			fileName:    "test999.txt", | 			fileName:    "test999.txt", | ||||||
| 			runner: oscommands.NewFakeRunner(t). | 			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 cat-file -e HEAD^:"test999.txt"`, "", nil). | ||||||
| 				Expect(`git checkout HEAD^ -- "test999.txt"`, "", nil). | 				Expect(`git checkout HEAD^ -- "test999.txt"`, "", nil). | ||||||
| 				Expect(`git commit --amend --no-edit --allow-empty`, "", nil). | 				Expect(`git commit --amend --no-edit --allow-empty`, "", nil). | ||||||
|   | |||||||
| @@ -45,9 +45,7 @@ var RebaseDoesNotAutosquash = NewIntegrationTest(NewIntegrationTestArgs{ | |||||||
| 			Confirm() | 			Confirm() | ||||||
|  |  | ||||||
| 		t.Views().Commits().Lines( | 		t.Views().Commits().Lines( | ||||||
| 			/* Expected the fixup to be kept, but it's gone: |  | ||||||
| 			Contains("fixup! branch commit"), | 			Contains("fixup! branch commit"), | ||||||
| 			*/ |  | ||||||
| 			Contains("branch commit"), | 			Contains("branch commit"), | ||||||
| 			Contains("master commit"), | 			Contains("master commit"), | ||||||
| 			Contains("base"), | 			Contains("base"), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user