mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
Signal ambiguity in the view-divergence-from-base-branch label
Same idea as the rebase menu's label: when the resolver reports the selected branch's base is ambiguous, show "pick: main, develop" in the parenthetical instead of just the config-order tiebreak, so the user knows the prompt will appear before they press 'b'.
This commit is contained in:
parent
272235925b
commit
d688fa9319
|
|
@ -295,15 +295,22 @@ func (self *BranchesController) viewUpstreamOptions(selectedBranch *models.Branc
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
baseBranchLabel := baseBranch
|
||||
if baseBranchLabel == "" {
|
||||
baseBranchLabel := helpers.ShortBranchName(baseBranch)
|
||||
switch {
|
||||
case baseBranch == "":
|
||||
baseBranchLabel = self.c.Tr.CouldNotDetermineBaseBranch
|
||||
disabledReason = &types.DisabledReason{Text: self.c.Tr.CouldNotDetermineBaseBranch}
|
||||
case baseAmbiguous:
|
||||
shortNames := lo.Map(baseCandidates, func(ref string, _ int) string {
|
||||
return helpers.ShortBranchName(ref)
|
||||
})
|
||||
baseBranchLabel = utils.ResolvePlaceholderString(self.c.Tr.PickBaseBranchLabel,
|
||||
map[string]string{"candidates": strings.Join(shortNames, ", ")},
|
||||
)
|
||||
}
|
||||
shortBaseBranchName := helpers.ShortBranchName(baseBranchLabel)
|
||||
label := utils.ResolvePlaceholderString(
|
||||
self.c.Tr.ViewDivergenceFromBaseBranch,
|
||||
map[string]string{"baseBranch": shortBaseBranchName},
|
||||
map[string]string{"baseBranch": baseBranchLabel},
|
||||
)
|
||||
viewDivergenceFromBaseBranchItem := &types.MenuItem{
|
||||
LabelColumns: []string{label},
|
||||
|
|
|
|||
Loading…
Reference in a new issue