mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-28 04:23:58 +03:00
Switch to branches view when checking out a commit
We move the code to push the branches context into CheckoutRef, this way it works consistently no matter where we call it from. Previously, checking out remote branches or tags would switch to the branches view, but checking out a commit did not. Note that it now also takes effect for undoing or redoing a checkout, which may be a bit questionable; but I still think it makes sense for this, too.
This commit is contained in:
@@ -43,14 +43,16 @@ var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Select(MatchesRegexp("Checkout commit [a-f0-9]+ as detached head")).
|
||||
Confirm()
|
||||
t.Views().Branches().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("* (HEAD detached at"),
|
||||
Contains("* (HEAD detached at").IsSelected(),
|
||||
Contains("branch1"),
|
||||
Contains("branch2"),
|
||||
Contains("master"),
|
||||
)
|
||||
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
NavigateToLine(Contains("two")).
|
||||
PressPrimaryAction()
|
||||
|
||||
@@ -65,8 +67,9 @@ var Checkout = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Select(Contains("Checkout branch 'master'")).
|
||||
Confirm()
|
||||
t.Views().Branches().
|
||||
IsFocused().
|
||||
Lines(
|
||||
Contains("master"),
|
||||
Contains("master").IsSelected(),
|
||||
Contains("branch1"),
|
||||
Contains("branch2"),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user