mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-01-26 01:41:35 +03:00
Fix the main view display after reverting a commit (#5138)
After reverting a commit, the main view would show the diff of a commit that is not the selected one.
This commit is contained in:
@@ -869,7 +869,7 @@ func (self *LocalCommitsController) revert(commits []*models.Commit, start, end
|
||||
return err
|
||||
}
|
||||
self.context().MoveSelection(len(commits))
|
||||
self.context().FocusLine()
|
||||
self.context().HandleFocus(types.OnFocusOpts{})
|
||||
|
||||
if mustStash {
|
||||
if err := self.c.Git().Stash.Pop(0); err != nil {
|
||||
|
||||
@@ -32,6 +32,9 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Contains("Revert \"first commit\""),
|
||||
Contains("first commit").IsSelected(),
|
||||
).
|
||||
Tap(func() {
|
||||
t.Views().Main().Content(Contains("+myfile content"))
|
||||
}).
|
||||
SelectPreviousItem()
|
||||
|
||||
t.Views().Main().Content(Contains("-myfile content"))
|
||||
|
||||
Reference in New Issue
Block a user