From a83fc5e34328dae1a2d5fe98f9ef40bcd58e48b0 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 3 Jul 2025 16:23:11 +0200 Subject: [PATCH] Use a better name for the auto-stash for undo --- pkg/gui/controllers/undo_controller.go | 2 +- pkg/i18n/english.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/undo_controller.go b/pkg/gui/controllers/undo_controller.go index b7979d2b6..ecff5bea8 100644 --- a/pkg/gui/controllers/undo_controller.go +++ b/pkg/gui/controllers/undo_controller.go @@ -260,7 +260,7 @@ func (self *UndoController) hardResetWithAutoStash(commitHash string, options ha dirtyWorkingTree := self.c.Helpers().WorkingTree.IsWorkingTreeDirty() if dirtyWorkingTree { return self.c.WithWaitingStatus(options.WaitingStatus, func(gocui.Task) error { - if err := self.c.Git().Stash.Push(self.c.Tr.StashPrefix + commitHash); err != nil { + if err := self.c.Git().Stash.Push(fmt.Sprintf(self.c.Tr.AutoStashForUndo, utils.ShortHash(commitHash))); err != nil { return err } if err := reset(); err != nil { diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index ca7377a8e..9c6663d9a 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -448,6 +448,7 @@ type TranslationSet struct { AutoStashTitle string AutoStashPrompt string StashPrefix string + AutoStashForUndo string Discard string DiscardChangesTitle string DiscardFileChangesTooltip string @@ -1541,6 +1542,7 @@ func EnglishTranslationSet() *TranslationSet { AutoStashTitle: "Autostash?", AutoStashPrompt: "You must stash and pop your changes to bring them across. Do this automatically? (enter/esc)", StashPrefix: "Auto-stashing changes for ", + AutoStashForUndo: "Auto-stashing changes for undoing to %s", Discard: "Discard", DiscardFileChangesTooltip: "View options for discarding changes to the selected file.", DiscardChangesTitle: "Discard changes",