]> git.ipfire.org Git - thirdparty/git.git/commitdiff
tests: do not negate test_path_exists
authorJunio C Hamano <gitster@pobox.com>
Tue, 16 May 2023 02:26:44 +0000 (19:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 May 2023 16:13:55 +0000 (09:13 -0700)
As a way to assert the path 'foo' is missing, "! test_path_exists
foo" is a poor way to do so, as the helper is designed to complain
when 'foo' is missing, but the intention of the author who used
negated form was to make sure it does not exist.  This does not
help debugging the tests.

Use test_path_is_missing instead, which is a more appropriate helper.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4067-diff-partial-clone.sh
t/t4115-apply-symlink.sh

index f60f5cbd65f049e1d3148bae352f3c6032454f2e..7af3a08862dec8a17b113191a3dbea56b0995cd3 100755 (executable)
@@ -151,7 +151,7 @@ test_expect_success 'diff does not fetch anything if inexact rename detection is
 
        # Ensure no fetches.
        GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
-       ! test_path_exists trace
+       test_path_is_missing trace
 '
 
 test_expect_success 'diff --break-rewrites fetches only if necessary, and batches blobs if it does' '
@@ -171,7 +171,7 @@ test_expect_success 'diff --break-rewrites fetches only if necessary, and batche
 
        # Ensure no fetches.
        GIT_TRACE_PACKET="$(pwd)/trace" git -C client diff --raw -M HEAD^ HEAD &&
-       ! test_path_exists trace &&
+       test_path_is_missing trace &&
 
        # But with --break-rewrites, ensure that there is exactly 1 negotiation
        # by checking that there is only 1 "done" line sent. ("done" marks the
index e95e6d4e7d6419236c1e8bb9bc519b05ea8efec3..a22a90d552a8ac8beb61d02b6e373a43951be7a1 100755 (executable)
@@ -74,7 +74,7 @@ test_expect_success SYMLINKS 'symlink escape when creating new files' '
        error: affected file ${SQ}renamed-symlink/create-me${SQ} is beyond a symbolic link
        EOF
        test_cmp expected_stderr stderr &&
-       ! test_path_exists .git/create-me
+       test_path_is_missing .git/create-me
 '
 
 test_expect_success SYMLINKS 'symlink escape when modifying file' '