mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-06 22:33:07 +02:00
Adjust selection after cherry-picking commits
Keep the same commit selected, by moving the selection down by the number of cherry-picked commits. We also do this when reverting commits, and it is possible now that we use a sync waiting status. We also need to turn the refresh that happens as part of CheckMergeOrRebase into a sync one, so that the commits list is up to date and the new selection isn't clamped.
This commit is contained in:
@ -73,9 +73,9 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
t.Views().Information().Content(DoesNotContain("commits copied"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("four"),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("two").IsSelected(),
|
||||
Contains("one"),
|
||||
Contains("base"),
|
||||
)
|
||||
@ -102,9 +102,9 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
t.Views().Information().Content(DoesNotContain("commits copied"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("four"),
|
||||
Contains("three"),
|
||||
Contains("base"),
|
||||
Contains("base").IsSelected(),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
@ -79,8 +79,8 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Contains("--- Pending rebase todos ---"),
|
||||
Contains("pick CI two"),
|
||||
Contains("--- Commits ---"),
|
||||
Contains(" CI three").IsSelected(),
|
||||
Contains(" CI one"),
|
||||
Contains(" CI three"),
|
||||
Contains(" CI one").IsSelected(),
|
||||
Contains(" CI base"),
|
||||
).
|
||||
Tap(func() {
|
||||
@ -88,8 +88,8 @@ var CherryPickDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
}).
|
||||
Lines(
|
||||
Contains("CI two"),
|
||||
Contains("CI three").IsSelected(),
|
||||
Contains("CI one"),
|
||||
Contains("CI three"),
|
||||
Contains("CI one").IsSelected(),
|
||||
Contains("CI base"),
|
||||
)
|
||||
},
|
||||
|
@ -63,9 +63,10 @@ var CherryPickMerge = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
t.Views().Information().Content(DoesNotContain("commit copied"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("Merge branch 'second-branch'").IsSelected(),
|
||||
Contains("base"),
|
||||
)
|
||||
Contains("Merge branch 'second-branch'"),
|
||||
Contains("base").IsSelected(),
|
||||
).
|
||||
SelectPreviousItem()
|
||||
|
||||
t.Views().Main().ContainsLines(
|
||||
Contains("Merge branch 'second-branch'"),
|
||||
|
@ -70,9 +70,9 @@ var CherryPickRange = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
t.Views().Information().Content(DoesNotContain("commits copied"))
|
||||
}).
|
||||
Lines(
|
||||
Contains("four").IsSelected(),
|
||||
Contains("four"),
|
||||
Contains("three"),
|
||||
Contains("two"),
|
||||
Contains("two").IsSelected(),
|
||||
Contains("one"),
|
||||
Contains("base"),
|
||||
)
|
||||
|
@ -43,8 +43,8 @@ var CherryPick = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Confirm()
|
||||
}).
|
||||
Lines(
|
||||
Contains("three").IsSelected(),
|
||||
Contains("one"),
|
||||
Contains("three"),
|
||||
Contains("one").IsSelected(),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
Reference in New Issue
Block a user