1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

Rename OnCommitSuccess to ClearPreservedCommitMessage

In one case it was actually called *before* making a commit (when switching from
the commit message panel to committing in the editor). And clearing the
preserved message is the only thing it does, so name it after what it does
rather than when it's called.
This commit is contained in:
Chris McDonnell
2025-05-15 18:27:53 +02:00
committed by Stefan Haller
parent 04bacbf9ce
commit 47f1d847f1
2 changed files with 3 additions and 4 deletions

View File

@ -112,7 +112,7 @@ func (self *WorkingTreeHelper) handleCommit(summary string, description string,
self.c.LogAction(self.c.Tr.Actions.Commit)
return self.gpgHelper.WithGpgHandling(cmdObj, git_commands.CommitGpgSign, self.c.Tr.CommittingStatus,
func() error {
self.commitsHelper.OnCommitSuccess()
self.commitsHelper.ClearPreservedCommitMessage()
return nil
}, nil)
}
@ -124,7 +124,7 @@ func (self *WorkingTreeHelper) switchFromCommitMessagePanelToEditor(filepath str
// access to the last message that the user typed, and it might be very
// different from what was last in the commit panel. So the best we can do
// here is to always clear the remembered commit message.
self.commitsHelper.OnCommitSuccess()
self.commitsHelper.ClearPreservedCommitMessage()
self.c.LogAction(self.c.Tr.Actions.Commit)
return self.c.RunSubprocessAndRefresh(