From: Ryan Biesemeyer Date: Thu, 09 Jan 2014 00:45:42 GMT Subject: [PATCH v2 2/4] t7505: ensure cleanup after hook blocks merge Message-ID: <1389228344-38813-3-git-send-email-ryan@yaauie.com> In-Reply-To: <1389228344-38813-1-git-send-email-ryan@yaauie.com> Signed-off-by: Ryan Biesemeyer --- t/t7505-prepare-commit-msg-hook.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh index 1c95652..697ecc0 100755 --- a/t/t7505-prepare-commit-msg-hook.sh +++ b/t/t7505-prepare-commit-msg-hook.sh @@ -168,18 +168,19 @@ test_expect_success 'with failing hook (--no-verify)' ' ' test_expect_success 'with failing hook (merge)' ' - - git checkout -B other HEAD@{1} && - echo "more" >> file && - git add file && - rm -f "$HOOK" && - git commit -m other && - write_script "$HOOK" <<-EOF && - exit 1 - EOF - git checkout - && - test_must_fail git merge other - + test_when_finished "git merge --abort" && + ( + git checkout -B other HEAD@{1} && + echo "more" >> file && + git add file && + rm -f "$HOOK" && + git commit -m other && + write_script "$HOOK" <<-EOF && + exit 1 + EOF + git checkout - && + test_must_fail git merge other + ) ' test_done -- 1.8.5