]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t7508: don't use `test_must_fail test_cmp`
authorDenton Liu <liu.denton@gmail.com>
Mon, 20 Apr 2020 08:54:41 +0000 (04:54 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2020 20:12:13 +0000 (13:12 -0700)
The test_must_fail function should only be used for git commands since
we assume that external commands work sanely. Since test_cmp() just
wraps an external command, replace `test_must_fail test_cmp` with
`! test_cmp`.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7508-status.sh

index 482ce3510edd1007118d52fbb36111a8b0d09247..8e969f3e3680d856073460b5b15e524ad9170d7f 100755 (executable)
@@ -1471,7 +1471,7 @@ test_expect_success '"status.branch=true" same as "-b"' '
 test_expect_success '"status.branch=true" different from "--no-branch"' '
        git status -s --no-branch  >expected_nobranch &&
        git -c status.branch=true status -s >actual &&
-       test_must_fail test_cmp expected_nobranch actual
+       ! test_cmp expected_nobranch actual
 '
 
 test_expect_success '"status.branch=true" weaker than "--no-branch"' '