summaryrefslogtreecommitdiff
path: root/t/t7505-prepare-commit-msg-hook.sh
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2018-01-24 12:34:22 +0000
committerJunio C Hamano <gitster@pobox.com>2018-01-24 11:01:31 -0800
commit66618a50f9c9f008d7aef751418f12ba9bfc6b85 (patch)
tree76a32ec2bf46ceec61faef339e1f7d22b473e34a /t/t7505-prepare-commit-msg-hook.sh
parent15cd6d3a259c3c6d8b16ffa4793505720db45e0c (diff)
downloadgit-66618a50f9c9f008d7aef751418f12ba9bfc6b85.tar.gz
sequencer: run 'prepare-commit-msg' hookpw/sequencer-in-process-commit
Commit 356ee4659b ("sequencer: try to commit without forking 'git commit'", 2017-11-24) forgot to run the 'prepare-commit-msg' hook when creating the commit. Fix this by writing the commit message to a different file and running the hook. Using a different file means that if the commit is cancelled the original message file is unchanged. Also move the checks for an empty commit so the order matches 'git commit'. Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7505-prepare-commit-msg-hook.sh')
-rwxr-xr-xt/t7505-prepare-commit-msg-hook.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index c1f68cbcbf..1f43b3cd4c 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -252,10 +252,10 @@ test_rebase () {
'
}
-test_rebase failure -i
-test_rebase failure -p
+test_rebase success -i
+test_rebase success -p
-test_expect_failure 'with hook (cherry-pick)' '
+test_expect_success 'with hook (cherry-pick)' '
test_when_finished "git checkout -f master" &&
git checkout -B other b &&
git cherry-pick rebase-1 &&
@@ -310,7 +310,7 @@ test_expect_success 'with failing hook (merge)' '
'
-test_expect_failure C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
+test_expect_success C_LOCALE_OUTPUT 'with failing hook (cherry-pick)' '
test_when_finished "git checkout -f master" &&
git checkout -B other b &&
test_must_fail git cherry-pick rebase-1 2>actual &&