Skip to content

Commit

Permalink
Allow --no-verify to bypass commit-msg hook
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wincent Colaiuta authored and Junio C Hamano committed Dec 9, 2007
1 parent 2ea7fe0 commit 6b95655
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 6b95655

Please sign in to comment.