Skip to content

Commit f20b7ea

Browse files
committed
Add test demonstrating problem with main view display when pressing e in a stack of branches
We keep the same commit selected (even though its index changed because of the added update-ref todo), which is nice; however, the main view shows the diff of the wrong commit, which is very confusing. I'm suprised that this hasn't been noticed yet. The reason why this happens is that we first do the refresh, which includes re-rendering the main view diff (with the same commit index as before, so the wrong one), and then we restore the correct commit index but don't render the main view again.
1 parent 14187c9 commit f20b7ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/integration/tests/interactive_rebase/drop_todo_commit_with_update_ref.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ var DropTodoCommitWithUpdateRef = NewIntegrationTest(NewIntegrationTestArgs{
4848
Contains("<-- YOU ARE HERE --- commit 02").IsSelected(),
4949
Contains("CI commit 01"),
5050
).
51+
Tap(func() {
52+
/* EXPECTED:
53+
t.Views().Main().Content(Contains("commit 02"))
54+
ACTUAL: */
55+
t.Views().Main().Content(Contains("commit 03"))
56+
}).
5157
NavigateToLine(Contains("commit 06")).
5258
Press(keys.Universal.Remove)
5359

0 commit comments

Comments
 (0)