Skip to content

Commit

Permalink
builtin-commit: run commit-msg hook with correct message file
Browse files Browse the repository at this point in the history
It should run with $GIT_DIR/COMMIT_EDITMSG, not just COMMIT_EDITMSG.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Nov 23, 2007
1 parent bc5d248 commit e06ad5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down

0 comments on commit e06ad5f

Please sign in to comment.