1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Fix the bug described in the previous commit

What happens here is that when stopping on an "edit" todo entry, we rely on the
assumption that if the .git/rebase-merge/amend file exists, the command was
successful, and if it doesn't, there was a conflict. The problem is that when
you stop on an edit command, and then run a multi-commit cherry-pick or rebase,
this will delete the amend file. You may or may not consider this a bug in git;
to work around it, we also check the existence of the rebase-merge/message file,
which will be deleted as well by the cherry-pick or revert.
This commit is contained in:
Stefan Haller
2024-06-14 14:36:31 +02:00
parent 9b88052a4e
commit 5ba8d42c80
4 changed files with 35 additions and 35 deletions

View File

@ -45,7 +45,6 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
).
Press("X").
Lines(
/* EXPECTED:
Contains("pick").Contains("commit 04"),
Contains(`<-- YOU ARE HERE --- Revert "commit 01"`).IsSelected(),
Contains(`Revert "commit 02"`),
@ -53,15 +52,6 @@ var RevertDuringRebaseWhenStoppedOnEdit = NewIntegrationTest(NewIntegrationTestA
Contains("commit 02"),
Contains("commit 01"),
Contains("master commit"),
ACTUAL: */
Contains("pick").Contains("commit 04"),
Contains("edit").Contains("<-- CONFLICT --- commit 03").IsSelected(),
Contains(`Revert "commit 01"`),
Contains(`Revert "commit 02"`),
Contains("commit 03"),
Contains("commit 02"),
Contains("commit 01"),
Contains("master commit"),
)
},
})

View File

@ -84,7 +84,6 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
t.Views().Commits().
Lines(
/* EXPECTED:
Contains("pick").Contains("CI unrelated change 3"),
Contains("pick").Contains("CI unrelated change 2"),
Contains(`CI ◯ <-- YOU ARE HERE --- Revert "unrelated change 1"`),
@ -93,16 +92,6 @@ var RevertMultipleCommitsInInteractiveRebase = NewIntegrationTest(NewIntegration
Contains("CI ◯ add first line"),
Contains("CI ◯ unrelated change 1"),
Contains("CI ◯ add empty file"),
ACTUAL: */
Contains("pick").Contains("CI unrelated change 3"),
Contains("pick").Contains("CI unrelated change 2"),
Contains("edit CI <-- CONFLICT --- add second line"),
Contains(`CI ◯ Revert "unrelated change 1"`),
Contains(`CI ◯ Revert "add first line"`),
Contains("CI ◯ add second line"),
Contains("CI ◯ add first line"),
Contains("CI ◯ unrelated change 1"),
Contains("CI ◯ add empty file"),
)
t.Views().Options().Content(Contains("View rebase options: m"))