Thread (5 messages) 5 messages, 2 authors, 2023-05-16
STALE1136d

[PATCH 2/3] t2021: do not negate test_path_is_dir

From: Junio C Hamano <hidden>
Date: 2023-05-16 02:32:31
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 t/t2021-checkout-overwrite.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
index 034f62c13c..ecfacf0f7f 100755
--- a/t/t2021-checkout-overwrite.sh
+++ b/t/t2021-checkout-overwrite.sh
@@ -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
-- 
2.41.0-rc0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help