diff --git a/pkg/gui/controllers/helpers/merge_and_rebase_helper.go b/pkg/gui/controllers/helpers/merge_and_rebase_helper.go index 32553f2a9..b20ed2555 100644 --- a/pkg/gui/controllers/helpers/merge_and_rebase_helper.go +++ b/pkg/gui/controllers/helpers/merge_and_rebase_helper.go @@ -351,10 +351,18 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error { if err != nil { return err } - baseBranchLabel := baseBranch - if baseBranchLabel == "" { + baseBranchLabel := ShortBranchName(baseBranch) + switch { + case baseBranch == "": baseBranchLabel = self.c.Tr.CouldNotDetermineBaseBranch baseBranchDisabledReason = &types.DisabledReason{Text: self.c.Tr.CouldNotDetermineBaseBranch} + case baseAmbiguous: + shortNames := lo.Map(baseCandidates, func(ref string, _ int) string { + return ShortBranchName(ref) + }) + baseBranchLabel = utils.ResolvePlaceholderString(self.c.Tr.PickBaseBranchLabel, + map[string]string{"candidates": strings.Join(shortNames, ", ")}, + ) } menuItems := []*types.MenuItem{ @@ -410,7 +418,7 @@ func (self *MergeAndRebaseHelper) RebaseOntoRef(ref string) error { }, { Label: utils.ResolvePlaceholderString(self.c.Tr.RebaseOntoBaseBranch, - map[string]string{"baseBranch": ShortBranchName(baseBranchLabel)}, + map[string]string{"baseBranch": baseBranchLabel}, ), Keys: menuKey('b'), DisabledReason: baseBranchDisabledReason, diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index e736481cc..4b92a60ad 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -565,6 +565,7 @@ type TranslationSet struct { CouldNotDetermineBaseBranch string PickBaseBranchTitle string PickBaseBranchPrompt string + PickBaseBranchLabel string DivergenceSectionHeaderLocal string DivergenceSectionHeaderRemote string ViewUpstreamResetOptions string @@ -1719,6 +1720,7 @@ func EnglishTranslationSet() *TranslationSet { CouldNotDetermineBaseBranch: "Couldn't determine base branch", PickBaseBranchTitle: "Pick a base branch for {{.branchName}}", PickBaseBranchPrompt: "More than one configured main branch is a candidate for this branch's base. Pick which one to treat as its base.", + PickBaseBranchLabel: "pick: {{.candidates}}", DivergenceSectionHeaderLocal: "Local", DivergenceSectionHeaderRemote: "Remote", ViewUpstreamResetOptions: "Reset checked-out branch onto {{.upstream}}",