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

standardise helper args

This commit is contained in:
Jesse Duffield
2023-03-23 12:53:18 +11:00
parent 43251e7275
commit fc91ef6a59
19 changed files with 197 additions and 323 deletions

View File

@ -1,24 +1,20 @@
package helpers
import (
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
type AmendHelper struct {
c *types.HelperCommon
git *commands.GitCommand
c *HelperCommon
gpg *GpgHelper
}
func NewAmendHelper(
c *types.HelperCommon,
git *commands.GitCommand,
c *HelperCommon,
gpg *GpgHelper,
) *AmendHelper {
return &AmendHelper{
c: c,
git: git,
gpg: gpg,
}
}
@ -28,7 +24,7 @@ func (self *AmendHelper) AmendHead() error {
Title: self.c.Tr.AmendLastCommitTitle,
Prompt: self.c.Tr.SureToAmend,
HandleConfirm: func() error {
cmdObj := self.git.Commit.AmendHeadCmdObj()
cmdObj := self.c.Git().Commit.AmendHeadCmdObj()
self.c.LogAction(self.c.Tr.Actions.AmendCommit)
return self.gpg.WithGpgHandling(cmdObj, self.c.Tr.AmendingStatus, nil)
},