2023-03-09 14:36:43 +01:00
|
|
|
package helpers
|
|
|
|
|
|
|
|
type AmendHelper struct {
|
2023-03-23 12:53:18 +11:00
|
|
|
c *HelperCommon
|
2023-03-09 14:36:43 +01:00
|
|
|
gpg *GpgHelper
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewAmendHelper(
|
2023-03-23 12:53:18 +11:00
|
|
|
c *HelperCommon,
|
2023-03-09 14:36:43 +01:00
|
|
|
gpg *GpgHelper,
|
|
|
|
) *AmendHelper {
|
|
|
|
return &AmendHelper{
|
|
|
|
c: c,
|
|
|
|
gpg: gpg,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (self *AmendHelper) AmendHead() error {
|
2023-09-01 18:49:33 +02:00
|
|
|
cmdObj := self.c.Git().Commit.AmendHeadCmdObj()
|
|
|
|
self.c.LogAction(self.c.Tr.Actions.AmendCommit)
|
|
|
|
return self.gpg.WithGpgHandling(cmdObj, self.c.Tr.AmendingStatus, nil)
|
2023-03-09 14:36:43 +01:00
|
|
|
}
|