merge: Honor prepare-commit-msg return code
commit3e4141d08c8dc1964d53c2ce13de8876d29e6436
authorAntoine Pelisse <apelisse@gmail.com>
Wed, 2 Jan 2013 18:42:50 +0000 (2 19:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Jan 2013 17:10:11 +0000 (3 09:10 -0800)
tree44211fc071d585ac9ab7700d48c4f7e31baa322d
parent15999998fbda60552742275570947431b57108ae
merge: Honor prepare-commit-msg return code

65969d4 (merge: honor prepare-commit-msg hook, 2011-02-14) tried to
make "git commit" and "git merge" consistent, because a merge that
required user assistance has to be concluded with "git commit", but
back then only "git commit" triggered prepare-commit-msg hook.

When it added a call to run the prepare-commit-msg hook, however, it
forgot to check the exit code from the hook like "git commit" does,
and ended up replacing one inconsistency with another.

When prepare-commit-msg hook that is run from "git merge" exits with
a non-zero status, abort the commit.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
t/t7505-prepare-commit-msg-hook.sh