[PATCH v2 2/4] t7505: ensure cleanup after hook blocks merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Ryan Biesemeyer <ryan@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]