mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-11-25 22:32:13 +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 {
|
func (self *StashController) handleStashPop(stashEntry *models.StashEntry) error {
|
||||||
pop := func() error {
|
pop := func() error {
|
||||||
self.c.LogAction(self.c.Tr.Actions.PopStash)
|
self.c.LogAction(self.c.Tr.Actions.PopStash)
|
||||||
|
self.c.LogCommand("Popping stash "+stashEntry.Hash, false)
|
||||||
err := self.c.Git().Stash.Pop(stashEntry.Index)
|
err := self.c.Git().Stash.Pop(stashEntry.Index)
|
||||||
self.postStashRefresh()
|
self.postStashRefresh()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -162,6 +163,7 @@ func (self *StashController) handleStashDrop(stashEntries []*models.StashEntry)
|
|||||||
HandleConfirm: func() error {
|
HandleConfirm: func() error {
|
||||||
self.c.LogAction(self.c.Tr.Actions.DropStash)
|
self.c.LogAction(self.c.Tr.Actions.DropStash)
|
||||||
for i := len(stashEntries) - 1; i >= 0; i-- {
|
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)
|
err := self.c.Git().Stash.Drop(stashEntries[i].Index)
|
||||||
self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
self.c.Refresh(types.RefreshOptions{Scope: []types.RefreshableView{types.STASH}})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user