From ba12d08fee2e8cc0ef8015a1761afde747a2622c Mon Sep 17 00:00:00 2001 From: Johan Lindell Date: Mon, 28 Jun 2021 20:58:35 +0200 Subject: [PATCH] fix: commit hooks no longer run with cmd-git implementation (#157) --- internal/git/cmdgit/git.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/git/cmdgit/git.go b/internal/git/cmdgit/git.go index 4b09b6ba..a758cb12 100644 --- a/internal/git/cmdgit/git.go +++ b/internal/git/cmdgit/git.go @@ -80,7 +80,7 @@ func (g *Git) Commit(commitAuthor *domain.CommitAuthor, commitMessage string) er return err } - cmd = exec.Command("git", "commit", "-m", commitMessage) + cmd = exec.Command("git", "commit", "--no-verify", "-m", commitMessage) if commitAuthor != nil { cmd.Env = append(cmd.Env, @@ -92,6 +92,9 @@ func (g *Git) Commit(commitAuthor *domain.CommitAuthor, commitMessage string) er } _, err = g.run(cmd) + if err != nil { + return err + } if err := g.logDiff(); err != nil { return err