builtin-commit: run commit-msg hook with correct message file
authorJunio C Hamano <gitster@pobox.com>
Sun, 18 Nov 2007 20:21:17 +0000 (12:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 Nov 2007 01:05:04 +0000 (17:05 -0800)
It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-commit.c

index 7616dd152fec439e7d8b8bdcb046b1837e2b68ee..cd2f5cad1d3f1e985fcd2dfbc8537008d3cfbcbb 100644 (file)
@@ -598,7 +598,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
                launch_editor(git_path(commit_editmsg), &sb);
        else if (strbuf_read_file(&sb, git_path(commit_editmsg), 0) < 0)
                die("could not read commit message\n");
-       if (run_hook(index_file, "commit-msg", commit_editmsg))
+       if (run_hook(index_file, "commit-msg", git_path(commit_editmsg)))
                exit(1);
        stripspace(&sb, 1);
        if (sb.len < header_len ||