diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-24 19:03:29 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-24 19:18:09 +1100 |
commit | 58bdcbf1dd9dde9d18eea885d62f41d1ba469617 (patch) | |
tree | 50eed5a1f52b3b768ebb668b1b60ec62720b3708 /pkg/gui | |
parent | 88d685df533dbd800fde400b4842eb2a33b1ceeb (diff) |
always refresh after stash action
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/stash_panel.go | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go index 9b6760b7a..617642497 100644 --- a/pkg/gui/stash_panel.go +++ b/pkg/gui/stash_panel.go @@ -51,10 +51,12 @@ func (gui *Gui) handleStashApply() error { apply := func() error { gui.logAction(gui.Tr.Actions.Stash) - if err := gui.Git.Stash.Apply(stashEntry.Index); err != nil { + err := gui.Git.Stash.Apply(stashEntry.Index) + _ = gui.postStashRefresh() + if err != nil { return gui.surfaceError(err) } - return gui.postStashRefresh() + return nil } if skipStashWarning { @@ -80,10 +82,12 @@ func (gui *Gui) handleStashPop() error { pop := func() error { gui.logAction(gui.Tr.Actions.Stash) - if err := gui.Git.Stash.Pop(stashEntry.Index); err != nil { + err := gui.Git.Stash.Pop(stashEntry.Index) + _ = gui.postStashRefresh() + if err != nil { return gui.surfaceError(err) } - return gui.postStashRefresh() + return nil } if skipStashWarning { @@ -110,10 +114,12 @@ func (gui *Gui) handleStashDrop() error { prompt: gui.Tr.SureDropStashEntry, handleConfirm: func() error { gui.logAction(gui.Tr.Actions.Stash) - if err := gui.Git.Stash.Drop(stashEntry.Index); err != nil { + err := gui.Git.Stash.Drop(stashEntry.Index) + _ = gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{STASH}}) + if err != nil { return gui.surfaceError(err) } - return gui.postStashRefresh() + return nil }, }) } @@ -130,10 +136,12 @@ func (gui *Gui) handleStashSave(stashFunc func(message string) error) error { return gui.prompt(promptOpts{ title: gui.Tr.StashChanges, handleConfirm: func(stashComment string) error { - if err := stashFunc(stashComment); err != nil { + err := stashFunc(stashComment) + _ = gui.postStashRefresh() + if err != nil { return gui.surfaceError(err) } - return gui.refreshSidePanels(refreshOptions{scope: []RefreshableView{STASH, FILES}}) + return nil }, }) } |