]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1409: use test_path_is_missing()
authorDenton Liu <liu.denton@gmail.com>
Fri, 20 Dec 2019 18:15:58 +0000 (10:15 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Dec 2019 19:30:45 +0000 (11:30 -0800)
The test_must_fail() function should only be used for git commands since
we should assume that external commands work sanely. Replace
`test_must_fail test -f` with `test_path_is_missing` since we expect
these paths to not exist.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1409-avoid-packing-refs.sh

index f74d890e8225c770cebfacf87962602eb8f22928..be12fb63506e2a8c242e876526dbe1d60e105f49 100755 (executable)
@@ -27,15 +27,15 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'do not create packed-refs file gratuitously' '
-       test_must_fail test -f .git/packed-refs &&
+       test_path_is_missing .git/packed-refs &&
        git update-ref refs/heads/foo $A &&
-       test_must_fail test -f .git/packed-refs &&
+       test_path_is_missing .git/packed-refs &&
        git update-ref refs/heads/foo $B &&
-       test_must_fail test -f .git/packed-refs &&
+       test_path_is_missing .git/packed-refs &&
        git update-ref refs/heads/foo $C $B &&
-       test_must_fail test -f .git/packed-refs &&
+       test_path_is_missing .git/packed-refs &&
        git update-ref -d refs/heads/foo &&
-       test_must_fail test -f .git/packed-refs
+       test_path_is_missing .git/packed-refs
 '
 
 test_expect_success 'check that marking the packed-refs file works' '