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

Extract amendHead function into new AmendHelper

This commit is contained in:
Stefan Haller
2023-03-09 14:36:43 +01:00
parent 7513d77567
commit 85fdb700ba
4 changed files with 43 additions and 11 deletions

View File

@ -567,15 +567,7 @@ func (self *FilesController) handleAmendCommitPress() error {
return self.c.ErrorMsg(self.c.Tr.NoCommitToAmend)
}
return self.c.Confirm(types.ConfirmOpts{
Title: self.c.Tr.AmendLastCommitTitle,
Prompt: self.c.Tr.SureToAmend,
HandleConfirm: func() error {
cmdObj := self.git.Commit.AmendHeadCmdObj()
self.c.LogAction(self.c.Tr.Actions.AmendCommit)
return self.helpers.GPG.WithGpgHandling(cmdObj, self.c.Tr.AmendingStatus, nil)
},
})
return self.helpers.AmendHelper.AmendHead()
}
func (self *FilesController) handleStatusFilterPressed() error {