]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t9164: use test_must_fail only on git commands
authorDenton Liu <liu.denton@gmail.com>
Mon, 20 Apr 2020 08:54:44 +0000 (04:54 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2020 20:30:11 +0000 (13:30 -0700)
The `test_must_fail` function should only be used for git commands;
we are not in the business of catching segmentation fault by external
commands.  Shell helper functions test_cmp and svn_cmd used in this
script are wrappers around external commands, so just use `! cmd`
instead of `test_must_fail cmd`

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9164-git-svn-dcommit-concurrent.sh

index 90346ff4e92ac06d6ca9fd8ea7b5b7d4f1f7f374..8466269bf50b66dd8d55cadc891600172659438e 100755 (executable)
@@ -92,7 +92,7 @@ test_expect_success 'check if post-commit hook creates a concurrent commit' '
                echo 1 >> file &&
                svn_cmd commit -m "changing file" &&
                svn_cmd up &&
-               test_must_fail test_cmp auto_updated_file au_file_saved
+               ! test_cmp auto_updated_file au_file_saved
        )
 '
 
@@ -103,7 +103,7 @@ test_expect_success 'check if pre-commit hook fails' '
                echo 2 >> file &&
                svn_cmd commit -m "changing file once again" &&
                echo 3 >> file &&
-               test_must_fail svn_cmd commit -m "this commit should fail" &&
+               ! svn_cmd commit -m "this commit should fail" &&
                svn_cmd revert file
        )
 '