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

refactor: Express WithGpgHelper with a config key parameter

This commit is contained in:
Chris McDonnell
2025-03-15 23:12:39 -04:00
committed by Stefan Haller
parent 6fb3b7430c
commit f779a5878d
5 changed files with 28 additions and 10 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"regexp"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/context"
@ -111,10 +112,11 @@ func (self *WorkingTreeHelper) HandleCommitPressWithMessage(initialMessage strin
func (self *WorkingTreeHelper) handleCommit(summary string, description string, forceSkipHooks bool) error {
cmdObj := self.c.Git().Commit.CommitCmdObj(summary, description, forceSkipHooks)
self.c.LogAction(self.c.Tr.Actions.Commit)
return self.gpgHelper.WithGpgHandling(cmdObj, self.c.Tr.CommittingStatus, func() error {
self.commitsHelper.OnCommitSuccess()
return nil
})
return self.gpgHelper.WithGpgHandling(cmdObj, git_commands.CommitGpgSign, self.c.Tr.CommittingStatus,
func() error {
self.commitsHelper.OnCommitSuccess()
return nil
})
}
func (self *WorkingTreeHelper) switchFromCommitMessagePanelToEditor(filepath string, forceSkipHooks bool) error {