summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-03-27 17:41:07 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-27 18:16:16 +1100
commite011acbab2952c8f58406a79651f4873d57a2de4 (patch)
tree0d964f909ce9978e8f6c998db045d8371166aefb /pkg
parent3e5d4b2c749322351c781c4427852ff4393fcd4f (diff)
better logging for stash flow
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/controllers/files_controller.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/gui/controllers/files_controller.go b/pkg/gui/controllers/files_controller.go
index 88e91771f..d88554aae 100644
--- a/pkg/gui/controllers/files_controller.go
+++ b/pkg/gui/controllers/files_controller.go
@@ -559,16 +559,14 @@ func (self *FilesController) createStashMenu() error {
{
DisplayString: self.c.Tr.LcStashAllChanges,
OnPress: func() error {
- self.c.LogAction(self.c.Tr.Actions.StashAllChanges)
- return self.handleStashSave(self.git.Stash.Save)
+ return self.handleStashSave(self.git.Stash.Save, self.c.Tr.Actions.StashAllChanges)
},
Key: 's',
},
{
DisplayString: self.c.Tr.LcStashStagedChanges,
OnPress: func() error {
- self.c.LogAction(self.c.Tr.Actions.StashStagedChanges)
- return self.handleStashSave(self.git.Stash.SaveStagedChanges)
+ return self.handleStashSave(self.git.Stash.SaveStagedChanges, self.c.Tr.Actions.StashStagedChanges)
},
Key: 'S',
},
@@ -577,7 +575,7 @@ func (self *FilesController) createStashMenu() error {
}
func (self *FilesController) stash() error {
- return self.handleStashSave(self.git.Stash.Save)
+ return self.handleStashSave(self.git.Stash.Save, self.c.Tr.Actions.StashAllChanges)
}
func (self *FilesController) createResetToUpstreamMenu() error {
@@ -605,7 +603,7 @@ func (self *FilesController) toggleTreeView() error {
return self.c.PostRefreshUpdate(self.context())
}
-func (self *FilesController) handleStashSave(stashFunc func(message string) error) error {
+func (self *FilesController) handleStashSave(stashFunc func(message string) error, action string) error {
if !self.helpers.WorkingTree.IsWorkingTreeDirty() {
return self.c.ErrorMsg(self.c.Tr.NoTrackedStagedFilesStash)
}
@@ -613,6 +611,8 @@ func (self *FilesController) handleStashSave(stashFunc func(message string) erro
return self.c.Prompt(types.PromptOpts{
Title: self.c.Tr.StashChanges,
HandleConfirm: func(stashComment string) error {
+ self.c.LogAction(action)
+
if err := stashFunc(stashComment); err != nil {
return self.c.Error(err)
}