summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/interactive_rebase
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-09-01 18:49:33 +0200
committerStefan Haller <stefan@haller-berlin.de>2023-09-01 18:55:16 +0200
commit843e12286f83ba9002ec7edbebcb675388605091 (patch)
tree45d963093aa540dcb7a04932166d1ab4b8412204 /pkg/integration/tests/interactive_rebase
parente60936e964e0b978532745f319fc4600c00de7d7 (diff)
Improve prompts when amending commits
This fixes two minor problems with the prompts: 1. When pressing shift-A in the local commits view, it would first prompt whether to stage all files, and then it would prompt whether to amend the commit at all. This doesn't make sense, it needs to be the other way round. 2. When pressing shift-A on the head commit in an interactive rebase, we would ask whether they want to amend the last commit, like when pressing shift-A in the files view. While this is technically correct, the fact that we're amending the head commit in this case is just an implementation detail, and from the user's point of view it's better to use the same prompt as we do for any other commit. To fix these, we remove the confirmation panel from AmendHelper.AmendHead() and instead add it at the two call sites, so that we have more control over this.
Diffstat (limited to 'pkg/integration/tests/interactive_rebase')
-rw-r--r--pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go4
-rw-r--r--pkg/integration/tests/interactive_rebase/amend_merge.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go b/pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go
index 16e34e160..10e7f0639 100644
--- a/pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go
+++ b/pkg/integration/tests/interactive_rebase/amend_head_commit_during_rebase.go
@@ -43,8 +43,8 @@ var AmendHeadCommitDuringRebase = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Commits.AmendToCommit).
Tap(func() {
t.ExpectPopup().Confirmation().
- Title(Equals("Amend last commit")).
- Content(Contains("Are you sure you want to amend last commit?")).
+ Title(Equals("Amend commit")).
+ Content(Contains("Are you sure you want to amend this commit with your staged files?")).
Confirm()
}).
Lines(
diff --git a/pkg/integration/tests/interactive_rebase/amend_merge.go b/pkg/integration/tests/interactive_rebase/amend_merge.go
index 13662ce54..3f01688ff 100644
--- a/pkg/integration/tests/interactive_rebase/amend_merge.go
+++ b/pkg/integration/tests/interactive_rebase/amend_merge.go
@@ -42,8 +42,8 @@ var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
Press(keys.Commits.AmendToCommit)
t.ExpectPopup().Confirmation().
- Title(Equals("Amend last commit")).
- Content(Contains("Are you sure you want to amend last commit?")).
+ Title(Equals("Amend commit")).
+ Content(Contains("Are you sure you want to amend this commit with your staged files?")).
Confirm()
// assuring we haven't added a brand new commit