From 65969d43d10512a44f5e7248e4404b946d1d0d9f Mon Sep 17 00:00:00 2001 From: Jay Soffian Date: Mon, 14 Feb 2011 20:07:50 -0500 Subject: merge: honor prepare-commit-msg hook When a merge is stopped due to conflicts or --no-commit, the subsequent commit calls the prepare-commit-msg hook. However, it is not called after a clean merge. Fix this inconsistency by invoking the hook after clean merges as well. Signed-off-by: Jay Soffian Signed-off-by: Junio C Hamano --- t/t7505-prepare-commit-msg-hook.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't') diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index ff189624d4..5b4b694f18 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505-prepare-commit-msg-hook.sh @@ -132,6 +132,18 @@ test_expect_success 'with hook (-c)' ' ' +test_expect_success 'with hook (merge)' ' + + head=`git rev-parse HEAD` && + git checkout -b other HEAD@{1} && + echo "more" >> file && + git add file && + git commit -m other && + git checkout - && + git merge other && + test "`git log -1 --pretty=format:%s`" = merge +' + cat > "$HOOK" <<'EOF' #!/bin/sh exit 1 -- cgit v1.2.3