Skip to content

Commit 2c206c3

Browse files
committed
Use abbreviated hash in undo confirmations
1 parent 50785a2 commit 2c206c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/gui/controllers/undo_controller.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func (self *UndoController) reflogUndo() error {
9090
case COMMIT:
9191
self.c.Confirm(types.ConfirmOpts{
9292
Title: self.c.Tr.Actions.Undo,
93-
Prompt: fmt.Sprintf(self.c.Tr.SoftResetPrompt, action.from),
93+
Prompt: fmt.Sprintf(self.c.Tr.SoftResetPrompt, utils.ShortHash(action.from)),
9494
HandleConfirm: func() error {
9595
self.c.LogAction(self.c.Tr.Actions.Undo)
9696
return self.c.WithWaitingStatus(undoingStatus, func(gocui.Task) error {
@@ -103,7 +103,7 @@ func (self *UndoController) reflogUndo() error {
103103
case REBASE:
104104
self.c.Confirm(types.ConfirmOpts{
105105
Title: self.c.Tr.Actions.Undo,
106-
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, action.from),
106+
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, utils.ShortHash(action.from)),
107107
HandleConfirm: func() error {
108108
self.c.LogAction(self.c.Tr.Actions.Undo)
109109
return self.hardResetWithAutoStash(action.from, hardResetOptions{
@@ -157,7 +157,7 @@ func (self *UndoController) reflogRedo() error {
157157
case COMMIT, REBASE:
158158
self.c.Confirm(types.ConfirmOpts{
159159
Title: self.c.Tr.Actions.Redo,
160-
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, action.to),
160+
Prompt: fmt.Sprintf(self.c.Tr.HardResetAutostashPrompt, utils.ShortHash(action.to)),
161161
HandleConfirm: func() error {
162162
self.c.LogAction(self.c.Tr.Actions.Redo)
163163
return self.hardResetWithAutoStash(action.to, hardResetOptions{

0 commit comments

Comments
 (0)