1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Keep same branch selected when refreshing branches

This wasn't necessary before, because the only available branch sorting option
was by recency, so the sort order couldn't change except by checking out
branches. Now, you can sort by committer date, so the branch order can change by
fetching; in this case it's important to keep the same branch selected. One
important use case is to rebase the checked-out branch onto master; you select
master, press "f" to fetch it (this can now change its position in the list),
and then press "r" to rebase. To make this work smoothly it's important to keep
master selected after pressing "f".
This commit is contained in:
Stefan Haller
2023-12-29 14:27:48 +01:00
parent 9867180202
commit 2c9b4770bc
7 changed files with 33 additions and 19 deletions

View File

@ -57,8 +57,8 @@ var SuggestionsCommand = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Branches().
Lines(
Contains("branch-three").IsSelected(),
Contains("branch-four"),
Contains("branch-three"),
Contains("branch-four").IsSelected(),
Contains("branch-two"),
Contains("branch-one"),
)