Skip to content

Commit 74b1255

Browse files
authored
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.
2 parents cf873b1 + a415d1b commit 74b1255

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/gui/controllers/local_commits_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ func (self *LocalCommitsController) revert(commits []*models.Commit, start, end
869869
return err
870870
}
871871
self.context().MoveSelection(len(commits))
872-
self.context().FocusLine()
872+
self.context().HandleFocus(types.OnFocusOpts{})
873873

874874
if mustStash {
875875
if err := self.c.Git().Stash.Pop(0); err != nil {

pkg/integration/tests/commit/revert.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ var Revert = NewIntegrationTest(NewIntegrationTestArgs{
3232
Contains("Revert \"first commit\""),
3333
Contains("first commit").IsSelected(),
3434
).
35+
Tap(func() {
36+
t.Views().Main().Content(Contains("+myfile content"))
37+
}).
3538
SelectPreviousItem()
3639

3740
t.Views().Main().Content(Contains("-myfile content"))

0 commit comments

Comments
 (0)