mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04: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:
parent
5cb80b8635
commit
438f5c0eda
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue