summaryrefslogtreecommitdiffstats
path: root/pkg/gui/stash_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-05-30 22:45:56 +1000
committerJesse Duffield <jessedduffield@gmail.com>2019-06-06 20:50:19 +1000
commit0f0fda16605059ebae73d29f0e4b9b5d1455ce73 (patch)
tree6d14bff955e00ee16f3170a0e0f80b7edc89d980 /pkg/gui/stash_panel.go
parentbd2170a99cb996f2e00467a3416645a85eaf0549 (diff)
allow stashing staged changes
reinstate old stash functionality with the 's' keybinding
Diffstat (limited to 'pkg/gui/stash_panel.go')
-rw-r--r--pkg/gui/stash_panel.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go
index 9c1851971..4a2b463ce 100644
--- a/pkg/gui/stash_panel.go
+++ b/pkg/gui/stash_panel.go
@@ -130,16 +130,15 @@ func (gui *Gui) stashDo(g *gocui.Gui, v *gocui.View, method string) error {
return gui.refreshFiles()
}
-func (gui *Gui) handleStashSave(g *gocui.Gui, filesView *gocui.View) error {
+func (gui *Gui) handleStashSave(stashFunc func(message string) error) error {
if len(gui.trackedFiles()) == 0 && len(gui.stagedFiles()) == 0 {
- return gui.createErrorPanel(g, gui.Tr.SLocalize("NoTrackedStagedFilesStash"))
+ return gui.createErrorPanel(gui.g, gui.Tr.SLocalize("NoTrackedStagedFilesStash"))
}
- gui.createPromptPanel(g, filesView, gui.Tr.SLocalize("StashChanges"), func(g *gocui.Gui, v *gocui.View) error {
- if err := gui.GitCommand.StashSave(gui.trimmedContent(v)); err != nil {
+ return gui.createPromptPanel(gui.g, gui.getFilesView(), gui.Tr.SLocalize("StashChanges"), func(g *gocui.Gui, v *gocui.View) error {
+ if err := stashFunc(gui.trimmedContent(v)); err != nil {
gui.createErrorPanel(g, err.Error())
}
gui.refreshStashEntries(g)
return gui.refreshFiles()
})
- return nil
}