diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-09 08:26:33 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-09 08:26:33 -0800 |
commit | ea12a7d6960c90dc0465a944b9e4426c8a972006 (patch) | |
tree | 327516f255b083403e29a1ee7eeebacb531475bd /builtin/merge.c | |
parent | a70472f4d65ef4c8ee89d3d5b8671ebdd22d2014 (diff) | |
parent | 3e4141d08c8dc1964d53c2ce13de8876d29e6436 (diff) | |
download | git-ea12a7d6960c90dc0465a944b9e4426c8a972006.tar.gz |
Merge branch 'ap/merge-stop-at-prepare-commit-msg-failure'
"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. t7505 may want a general clean-up but that is
a different topic.
* 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.c | 5 |
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); |