Skip to content

Commit bf4f7e2

Browse files
stefanhallerkarolzwolak
authored andcommitted
Log hashes when dropping/popping stashes
If you dropped/popped a stash accidentally, the logged hash can help recover it more easily.
1 parent 7f42147 commit bf4f7e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/gui/controllers/stash_controller.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ func (self *StashController) handleStashApply(stashEntry *models.StashEntry) err
129129
func (self *StashController) handleStashPop(stashEntry *models.StashEntry) error {
130130
pop := func() error {
131131
self.c.LogAction(self.c.Tr.Actions.PopStash)
132+
self.c.LogCommand("Popping stash "+stashEntry.Hash, false)
132133
err := self.c.Git().Stash.Pop(stashEntry.Index)
133134
self.postStashRefresh()
134135
if err != nil {
@@ -162,6 +163,7 @@ func (self *StashController) handleStashDrop(stashEntries []*models.StashEntry)
162163
HandleConfirm: func() error {
163164
self.c.LogAction(self.c.Tr.Actions.DropStash)
164165
for i := len(stashEntries) - 1; i >= 0; i-- {
166+
self.c.LogCommand("Dropping stash "+stashEntries[i].Hash, false)
165167
err := self.c.Git().Stash.Drop(stashEntries[i].Index)
166168
self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
167169
if err != nil {

0 commit comments

Comments
 (0)