From: Wincent Colaiuta Date: Sat, 8 Dec 2007 11:38:07 +0000 (+0100) Subject: Allow --no-verify to bypass commit-msg hook X-Git-Tag: v1.5.4-rc0~42 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b95655d7d2a5378e409ea0754b9b8d32ed939f8;p=git.git Allow --no-verify to bypass commit-msg hook At the moment the --no-verify switch to "git commit" instructs it to skip over the pre-commit hook. Here we teach "git commit --no-verify" to skip over the commit-msg hook as well. This brings the behaviour of builtin-commit back in line with git-commit.sh. Signed-off-by: Wincent Colaiuta Signed-off-by: Junio C Hamano --- diff --git a/builtin-commit.c b/builtin-commit.c index 19297ac02..2032ca314 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -792,7 +792,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix) rollback_index_files(); die("could not read commit message"); } - if (run_hook(index_file, "commit-msg", git_path(commit_editmsg))) { + if (!no_verify && + run_hook(index_file, "commit-msg", git_path(commit_editmsg))) { rollback_index_files(); exit(1); }