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 <win@wincent.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Wincent Colaiuta committed
Dec 8, 2007 at 12:38 UTC
6b95655d7d2a5378e409ea0754b9b8d32ed939f8
1 file changed
+2
-1
builtin-commit.c
+2
-1
@@ -792,7 +792,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
792
rollback_index_files();
793
die("could not read commit message");
794
}
795
- if (run_hook(index_file, "commit-msg", git_path(commit_editmsg))) {
795
+ if (!no_verify &&
796
+ run_hook(index_file, "commit-msg", git_path(commit_editmsg))) {
797
rollback_index_files();
798
exit(1);
799
}