fix restore branch keybinding conflict and i18n

This commit is contained in:
Samuel Onoja 2026-08-03 11:41:12 +01:00
parent c271831399
commit b04d4b4ed1
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View file

@ -1126,7 +1126,7 @@ func GetDefaultConfigForPlatform(platform string) *UserConfig {
FetchRemote: Keybinding{"f"},
AddForkRemote: Keybinding{"F"},
SortOrder: Keybinding{"s"},
RestoreBranch: Keybinding{"R"},
RestoreBranch: Keybinding{"<ctrl+r>"},
},
Commits: KeybindingCommitsConfig{
SquashDown: Keybinding{"s"},

View file

@ -605,16 +605,16 @@ func (self *BranchesController) restoreDeletedBranch() error {
branch.Recency,
},
OnPress: func() error {
self.c.LogAction(self.c.Tr.Actions.RestoreBranch)
upstream, err := self.c.Git().Branch.RestoreBranch(branch.Name, branch.CommitHash)
if err != nil {
return err
}
self.c.LogAction(self.c.Tr.Actions.RestoreBranch)
toast := utils.ResolvePlaceholderString(self.c.Tr.RestoredBranch, map[string]string{"branchName": branch.Name})
if upstream != "" {
self.c.Toast(fmt.Sprintf("%s %s (%s)", self.c.Tr.RestoredBranch, branch.Name, self.c.Tr.RestoredBranchUpstream))
} else {
self.c.Toast(fmt.Sprintf("%s %s", self.c.Tr.RestoredBranch, branch.Name))
toast = fmt.Sprintf("%s (%s)", toast, self.c.Tr.RestoredBranchUpstream)
}
self.c.Toast(toast)
self.c.Refresh(types.RefreshOptions{
Scope: []types.RefreshableView{types.BRANCHES},
})

View file

@ -1287,7 +1287,7 @@ func EnglishTranslationSet() *TranslationSet {
RestoreBranchTooltip: "Restore a locally deleted branch from the reflog. The branch's upstream will be re-attached if a matching remote-tracking branch still exists.",
RestoreBranchTitle: "Deleted branches",
NoDeletedBranches: "No deleted branches were found in the reflog",
RestoredBranch: "Restored branch",
RestoredBranch: "Restored branch '{{.branchName}}'",
RestoredBranchUpstream: "re-attached upstream",
ForceDeleteBranchTitle: "Force delete branch",
ForceDeleteBranchMessage: "'{{.selectedBranchName}}' is not fully merged. Are you sure you want to delete it?",