public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [GSoC PATCH] t1420-lost-found.sh: use test_path_is_file for error logging
@ 2026-01-04 16:15 Andrew Chitester
  2026-01-05  3:24 ` Junio C Hamano
  2026-01-06 13:26 ` [GSoC PATCH v2 1/1] t1420: modernize the lost-found test Andrew Chitester
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Chitester @ 2026-01-04 16:15 UTC (permalink / raw)
  To: git; +Cc: Andrew Chitester

This test will fail silently without giving any error message. Use
test_path_is_file in place of test -f to ensure this test errors with a
message.

Signed-off-by: Andrew Chitester <andchi@fastmail•com>
---
 t/t1420-lost-found.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1420-lost-found.sh b/t/t1420-lost-found.sh
index 2fb2f44f02..5fbb1d10ed 100755
--- a/t/t1420-lost-found.sh
+++ b/t/t1420-lost-found.sh
@@ -29,8 +29,8 @@ test_expect_success 'lost and found something' '
 	git reset --hard HEAD^ &&
 	git fsck --lost-found &&
 	test 2 = $(ls .git/lost-found/*/* | wc -l) &&
-	test -f .git/lost-found/commit/$(cat lost-commit) &&
-	test -f .git/lost-found/other/$(cat lost-other)
+	test_path_is_file .git/lost-found/commit/$(cat lost-commit) &&
+	test_path_is_file .git/lost-found/other/$(cat lost-other)
 '
 
 test_done
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-08  1:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-04 16:15 [GSoC PATCH] t1420-lost-found.sh: use test_path_is_file for error logging Andrew Chitester
2026-01-05  3:24 ` Junio C Hamano
2026-01-08  1:30   ` Andrew Chitester
2026-01-06 13:26 ` [GSoC PATCH v2 1/1] t1420: modernize the lost-found test Andrew Chitester

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox