1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-06 22:33:07 +02:00

Keep the same line selected after squashing fixup commits

This uses a bit of a heuristic that is hopefully correct most of the time.
This commit is contained in:
Stefan Haller
2023-08-22 15:47:32 +02:00
parent c6d20c876e
commit bb26979420
4 changed files with 210 additions and 18 deletions

View File

@ -46,10 +46,9 @@ var SquashFixupsAbove = NewIntegrationTest(NewIntegrationTestArgs{
}).
Lines(
Contains("commit 03"),
Contains("commit 02"),
Contains("commit 01").IsSelected(), // wrong, we want the previous line
).
SelectPreviousItem()
Contains("commit 02").IsSelected(),
Contains("commit 01"),
)
t.Views().Main().
Content(Contains("fixup content"))

View File

@ -45,11 +45,10 @@ var SquashFixupsInCurrentBranch = NewIntegrationTest(NewIntegrationTestArgs{
}).
Lines(
Contains("commit 02"),
Contains("commit 01"),
Contains("fixup! master commit").IsSelected(), // wrong, we want the previous line
Contains("commit 01").IsSelected(),
Contains("fixup! master commit"),
Contains("master commit"),
).
NavigateToLine(Contains("commit 01"))
)
t.Views().Main().
Content(Contains("fixup content"))