1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

implement signoff

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
This commit is contained in:
Mark Sagi-Kazar
2021-11-14 14:31:35 +01:00
committed by Jesse Duffield
parent b4ea565c99
commit fdf0d4a2c3
2 changed files with 14 additions and 4 deletions

View File

@@ -14,13 +14,17 @@ func (gui *Gui) handleCommitConfirm() error {
if message == "" {
return gui.createErrorPanel(gui.Tr.CommitWithoutMessageErr)
}
flags := ""
flags := []string{}
skipHookPrefix := gui.Config.GetUserConfig().Git.SkipHookPrefix
if skipHookPrefix != "" && strings.HasPrefix(message, skipHookPrefix) {
flags = "--no-verify"
flags = append(flags, "--no-verify")
}
cmdStr := gui.GitCommand.CommitCmdStr(message, flags)
if gui.Config.GetUserConfig().Git.Commit.SignOff {
flags = append(flags, "--signoff")
}
cmdStr := gui.GitCommand.CommitCmdStr(message, strings.Join(flags, " "))
gui.OnRunCommand(oscommands.NewCmdLogEntry(cmdStr, gui.Tr.Spans.Commit, true))
_ = gui.returnFromContext()
return gui.withGpgHandling(cmdStr, gui.Tr.CommittingStatus, func() error {