]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t5401: prefer test_path_is_* helper function
authorambar chakravartty <chakravarttyambar@gmail.com>
Sat, 1 Feb 2025 07:12:10 +0000 (12:42 +0530)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Feb 2025 22:11:19 +0000 (14:11 -0800)
"test -f" does not provide a nice error message when we hit test
failures, so use test_path_is_file instead.

Signed-off-by: ambar chakravartty <amch9605@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5401-update-hooks.sh

index 723d1e17ec67535a6c8a4e320ba08234fb0295e9..17a46fd3bae14f2993940fca77048ba91ab69d8b 100755 (executable)
@@ -64,14 +64,14 @@ test_expect_success 'updated as expected' '
 '
 
 test_expect_success 'hooks ran' '
-       test -f victim.git/pre-receive.args &&
-       test -f victim.git/pre-receive.stdin &&
-       test -f victim.git/update.args &&
-       test -f victim.git/update.stdin &&
-       test -f victim.git/post-receive.args &&
-       test -f victim.git/post-receive.stdin &&
-       test -f victim.git/post-update.args &&
-       test -f victim.git/post-update.stdin
+       test_path_is_file victim.git/pre-receive.args &&
+       test_path_is_file victim.git/pre-receive.stdin &&
+       test_path_is_file victim.git/update.args &&
+       test_path_is_file victim.git/update.stdin &&
+       test_path_is_file victim.git/post-receive.args &&
+       test_path_is_file victim.git/post-receive.stdin &&
+       test_path_is_file victim.git/post-update.args &&
+       test_path_is_file victim.git/post-update.stdin
 '
 
 test_expect_success 'pre-receive hook input' '