diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go index b00a7eab8..eeda84784 100644 --- a/pkg/config/user_config.go +++ b/pkg/config/user_config.go @@ -1126,7 +1126,7 @@ func GetDefaultConfigForPlatform(platform string) *UserConfig { FetchRemote: Keybinding{"f"}, AddForkRemote: Keybinding{"F"}, SortOrder: Keybinding{"s"}, - RestoreBranch: Keybinding{"R"}, + RestoreBranch: Keybinding{""}, }, Commits: KeybindingCommitsConfig{ SquashDown: Keybinding{"s"}, diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go index e60fa8f0e..4b31de366 100644 --- a/pkg/gui/controllers/branches_controller.go +++ b/pkg/gui/controllers/branches_controller.go @@ -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}, }) diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 9d23b0375..fa51d85ea 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -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?",