]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t2021: do not negate test_path_is_dir
authorJunio C Hamano <gitster@pobox.com>
Tue, 16 May 2023 02:26:45 +0000 (19:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 May 2023 16:14:21 +0000 (09:14 -0700)
In this test, a path (some_dir) that is originally a directory is to
be removed and then to be replaced with a file of the same name.
The expectation is that the path becomes a file at the end.
However, "!  test_path_is_dir some_dir" is used to catch a breakage
that leaves the path as a directory.

But as with all the "test_path_is..." helpers, this use of the
helper makes it loud when the expectation (i.e. it is a directory)
is met, and otherwise is silent when it is not---this does not help
debugging.

Be more explicit and state that we expect the path to become a file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2021-checkout-overwrite.sh

index 034f62c13c5949cd4b8dbadf14013f7ce980db31..ecfacf0f7f3a5fa7c03fa837891c745dec10dda6 100755 (executable)
@@ -77,7 +77,7 @@ test_expect_success 'checkout --overwrite-ignore should succeed if only ignored
        echo autogenerated information >some_dir/ignore &&
        echo ignore >.git/info/exclude &&
        git checkout --overwrite-ignore df_conflict &&
-       ! test_path_is_dir some_dir
+       test_path_is_file some_dir
 '
 
 test_done