[PATCH 1/3] Allow --no-verify to bypass commit-msg hook
- From
Wincent Colaiuta <win@wincent.com>
- Date
- Dec 8, 2007, 11:38 UTC
- Message-ID
- <1197113889-16243-2-git-send-email-win@wincent.com>
- In-Reply-To
- <1197113889-16243-1-git-send-email-win@wincent.com>
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> --- builtin-commit.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin-commit.c b/builtin-commit.c index 2ec8223..df9377e 100644 --- a/builtin-commit.c +++ b/builtin-commit.c @@ -791,7 +791,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); }
-- 1.5.3.7.1115.gaa595