]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rev-parse test: use test_must_fail, not "if <command>; then false; fi"
authorFelipe Contreras <felipe.contreras@gmail.com>
Tue, 3 Sep 2013 17:06:18 +0000 (10:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Sep 2013 19:54:52 +0000 (12:54 -0700)
This way, if rev-parse segfaults then the test will fail instead
of treating it the same way as a controlled failure.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6101-rev-parse-parents.sh

index c47b8695da72da8ad359a22fc891d4be8c7c1159..416067c374358aca74111562c7f021dd4ee3bdd6 100755 (executable)
@@ -26,7 +26,7 @@ test_expect_success 'start^0' '
 '
 
 test_expect_success 'start^1 not valid' '
-       if git rev-parse --verify start^1; then false; else :; fi
+       test_must_fail git rev-parse --verify start^1
 '
 
 test_expect_success 'second^1 = second^' '
@@ -50,7 +50,7 @@ test_expect_success 'final^1^2 != final^1^1' '
 '
 
 test_expect_success 'final^1^3 not valid' '
-       if git rev-parse --verify final^1^3; then false; else :; fi
+       test_must_fail git rev-parse --verify final^1^3
 '
 
 test_expect_success '--verify start2^1' '