mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-10-08 22:52:12 +02:00
Log hashes when dropping/popping stashes
If you dropped/popped a stash accidentally, the logged hash can help recover it more easily.
This commit is contained in:
@@ -129,6 +129,7 @@ func (self *StashController) handleStashApply(stashEntry *models.StashEntry) err
|
||||
func (self *StashController) handleStashPop(stashEntry *models.StashEntry) error {
|
||||
pop := func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.PopStash)
|
||||
self.c.LogCommand("Popping stash "+stashEntry.Hash, false)
|
||||
err := self.c.Git().Stash.Pop(stashEntry.Index)
|
||||
self.postStashRefresh()
|
||||
if err != nil {
|
||||
@@ -162,6 +163,7 @@ func (self *StashController) handleStashDrop(stashEntries []*models.StashEntry)
|
||||
HandleConfirm: func() error {
|
||||
self.c.LogAction(self.c.Tr.Actions.DropStash)
|
||||
for i := len(stashEntries) - 1; i >= 0; i-- {
|
||||
self.c.LogCommand("Dropping stash "+stashEntries[i].Hash, false)
|
||||
err := self.c.Git().Stash.Drop(stashEntries[i].Index)
|
||||
self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user