summaryrefslogtreecommitdiff
path: root/builtin/merge.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-01-11 16:49:01 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-01-11 16:49:01 -0800
commitb663af57c31cb6353bd86e39b880cc9602262958 (patch)
tree7aad0671281be8da5ffd926466dafbfec533613a /builtin/merge.c
parentMerge branch 'jc/submittingpatches' into maint (diff)
parentmerge: Honor prepare-commit-msg return code (diff)
downloadtgif-b663af57c31cb6353bd86e39b880cc9602262958.tar.xz
Merge branch 'ap/merge-stop-at-prepare-commit-msg-failure' into maint
"git merge" started calling prepare-commit-msg hook like "git commit" does some time ago, but forgot to pay attention to the exit status of the hook. * ap/merge-stop-at-prepare-commit-msg-failure: merge: Honor prepare-commit-msg return code
Diffstat (limited to 'builtin/merge.c')
-rw-r--r--builtin/merge.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index a96e8eac19..3a31c4bc25 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -800,8 +800,9 @@ static void prepare_to_commit(struct commit_list *remoteheads)
if (0 < option_edit)
strbuf_add_lines(&msg, "# ", comment, strlen(comment));
write_merge_msg(&msg);
- run_hook(get_index_file(), "prepare-commit-msg",
- git_path("MERGE_MSG"), "merge", NULL, NULL);
+ if (run_hook(get_index_file(), "prepare-commit-msg",
+ git_path("MERGE_MSG"), "merge", NULL, NULL))
+ abort_commit(remoteheads, NULL);
if (0 < option_edit) {
if (launch_editor(git_path("MERGE_MSG"), NULL, NULL))
abort_commit(remoteheads, NULL);