Mention which command is continued in PromptToContinueRebase

When you are in the middle of a rebase, and you cherry-pick a commit which
conflicts, it helps to be clear on whether you are prompted to continue the
cherry-pick or the rebase.
This commit is contained in:
Stefan Haller 2024-06-12 14:45:45 +02:00
parent 542525743c
commit 362678e2ef
23 changed files with 27 additions and 25 deletions

View file

@ -226,7 +226,7 @@ func (self *MergeAndRebaseHelper) AbortMergeOrRebaseWithConfirm() error {
func (self *MergeAndRebaseHelper) PromptToContinueRebase() error {
self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.Continue,
Prompt: self.c.Tr.ConflictsResolved,
Prompt: fmt.Sprintf(self.c.Tr.ConflictsResolved, self.c.Git().Status.WorkingTreeState().CommandName()),
HandleConfirm: func() error {
// By the time we get here, we might have unstaged changes again,
// e.g. if the user had to fix build errors after resolving the

View file

@ -1391,7 +1391,7 @@ func EnglishTranslationSet() *TranslationSet {
SecondaryTitle: "Secondary",
ReflogCommitsTitle: "Reflog",
GlobalTitle: "Global keybindings",
ConflictsResolved: "All merge conflicts resolved. Continue?",
ConflictsResolved: "All merge conflicts resolved. Continue the %s?",
Continue: "Continue",
UnstagedFilesAfterConflictsResolved: "Files have been modified since conflicts were resolved. Auto-stage them and continue?",
Keybindings: "Keybindings",

View file

@ -1,5 +1,7 @@
package components
import "fmt"
// for running common actions
type Common struct {
t *TestDriver
@ -43,10 +45,10 @@ func (self *Common) AcknowledgeConflicts() {
Confirm()
}
func (self *Common) ContinueOnConflictsResolved() {
func (self *Common) ContinueOnConflictsResolved(command string) {
self.t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Content(Contains(fmt.Sprintf("All merge conflicts resolved. Continue the %s?", command))).
Confirm()
}

View file

@ -48,7 +48,7 @@ var Rebase = NewIntegrationTest(NewIntegrationTestArgs{
t.Views().Information().Content(Contains("Rebasing"))
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Information().Content(DoesNotContain("Rebasing"))

View file

@ -77,7 +77,7 @@ var RebaseAndDrop = NewIntegrationTest(NewIntegrationTestArgs{
IsFocused().
PressPrimaryAction()
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Information().Content(DoesNotContain("Rebasing"))

View file

@ -51,7 +51,7 @@ var RebaseConflictsFixBuildErrors = NewIntegrationTest(NewIntegrationTestArgs{
popup := t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?"))
Content(Contains("All merge conflicts resolved. Continue the rebase?"))
// While the popup is showing, fix some build errors
t.Shell().UpdateFile("file", "make it compile again")

View file

@ -69,7 +69,7 @@ var CherryPickConflicts = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
PressPrimaryAction()
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Files().IsEmpty()

View file

@ -61,7 +61,7 @@ func doTheRebaseForAmendTests(t *TestDriver, keys config.KeybindingConfig) {
t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Content(Contains("All merge conflicts resolved. Continue the rebase?")).
Cancel()
}

View file

@ -25,7 +25,7 @@ var ResolveExternally = NewIntegrationTest(NewIntegrationTestArgs{
}).
Press(keys.Universal.Refresh)
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("merge")
t.Views().Files().
IsEmpty()

View file

@ -51,6 +51,6 @@ var ResolveMultipleFiles = NewIntegrationTest(NewIntegrationTestArgs{
).
PressPrimaryAction()
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("merge")
},
})

View file

@ -43,7 +43,7 @@ var ResolveWithoutTrailingLf = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Alert().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Content(Contains("All merge conflicts resolved. Continue the merge?")).
Cancel()
t.Views().Files().

View file

@ -93,7 +93,7 @@ var DiscardAllDirChanges = NewIntegrationTest(NewIntegrationTestArgs{
Confirm()
}).
Tap(func() {
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("merge")
t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("Files have been modified since conflicts were resolved. Auto-stage them and continue?")).

View file

@ -53,7 +53,7 @@ var DiscardVariousChanges = NewIntegrationTest(NewIntegrationTestArgs{
t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Content(Contains("All merge conflicts resolved. Continue the merge?")).
Cancel()
discardOneByOne([]statusFile{

View file

@ -40,7 +40,7 @@ var DiscardVariousChangesRangeSelect = NewIntegrationTest(NewIntegrationTestArgs
t.ExpectPopup().Confirmation().
Title(Equals("Continue")).
Content(Contains("All merge conflicts resolved. Continue?")).
Content(Contains("All merge conflicts resolved. Continue the merge?")).
Cancel()
}).
Lines(

View file

@ -60,7 +60,7 @@ var AmendCommitWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
PressPrimaryAction() // pick "4"
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Common().AcknowledgeConflicts()

View file

@ -33,7 +33,7 @@ func handleConflictsFromSwap(t *TestDriver) {
SelectNextItem().
PressPrimaryAction() // pick "three"
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Common().AcknowledgeConflicts()
@ -56,7 +56,7 @@ func handleConflictsFromSwap(t *TestDriver) {
SelectNextItem().
PressPrimaryAction() // pick "two"
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Commits().
Focus().

View file

@ -71,7 +71,7 @@ var MoveToEarlierCommitFromAddedFile = NewIntegrationTest(NewIntegrationTestArgs
SelectNextItem().
PressPrimaryAction() // choose the version with all three lines
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Commits().
Focus().

View file

@ -67,7 +67,7 @@ var MoveToIndexFromAddedFileWithConflict = NewIntegrationTest(NewIntegrationTest
SelectNextItem().
PressPrimaryAction()
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.ExpectPopup().Alert().
Title(Equals("Error")).

View file

@ -62,7 +62,7 @@ var MoveToIndexWithConflict = NewIntegrationTest(NewIntegrationTestArgs{
).
PressPrimaryAction()
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.ExpectPopup().Alert().
Title(Equals("Error")).

View file

@ -60,7 +60,7 @@ var PullMergeConflict = NewIntegrationTest(NewIntegrationTestArgs{
).
PressPrimaryAction() // choose 'content4'
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("merge")
t.Views().Status().Content(Equals("↑2 repo → master"))

View file

@ -61,7 +61,7 @@ var PullRebaseConflict = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
PressPrimaryAction() // choose 'content4'
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Status().Content(Equals("↑1 repo → master"))

View file

@ -74,7 +74,7 @@ var PullRebaseInteractiveConflict = NewIntegrationTest(NewIntegrationTestArgs{
SelectNextItem().
PressPrimaryAction() // choose 'content4'
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Status().Content(Equals("↑2 repo → master"))

View file

@ -83,7 +83,7 @@ var PullRebaseInteractiveConflictDrop = NewIntegrationTest(NewIntegrationTestArg
SelectNextItem().
PressPrimaryAction() // choose 'content4'
t.Common().ContinueOnConflictsResolved()
t.Common().ContinueOnConflictsResolved("rebase")
t.Views().Status().Content(Equals("↑1 repo → master"))