{"thread":{"id":"64955","subject":"[GSOC PATCH v2] t2003: modernize path existence checks using test helpers","startedAt":"2026-02-09T11:25:02Z","lastAt":"2026-02-09T11:25:02Z","messageCount":1,"participants":["Burak Kaan Karaçay"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"535519","messageId":"20260209112444.1268765-1-bkkaracay@gmail.com","threadId":"64955","inReplyTo":null,"subject":"[GSOC PATCH v2] t2003: modernize path existence checks using test helpers","fromName":"Burak Kaan Karaçay","fromEmail":"bkkaracay@gmail.com","sentAt":"2026-02-09T11:24:44Z","receivedAt":"2026-02-09T11:25:02Z","isPatch":true,"sender":{"key":"bkkaracay@gmail.com","avatar":"https://avatars.githubusercontent.com/u/29117336?v=4"},"body":"The old style 'test -f' and 'test -d' checks are silent on failure,\nwhich makes debugging difficult.\n\nReplace them with the 'test_path_is_*' helpers which provide verbose\nerror messages when a test fails.\n\nSigned-off-by: Burak Kaan Karaçay <bkkaracay@gmail.com>\n---\nThank you for the review.\n\nChanges since v1:\n\n- Fixed subject line.\n- Split the command chain.\n\n t/t2003-checkout-cache-mkdir.sh | 50 ++++++++++++++++-----------------\n 1 file changed, 25 insertions(+), 25 deletions(-)\n\ndiff --git a/t/t2003-checkout-cache-mkdir.sh b/t/t2003-checkout-cache-mkdir.sh\nindex ff163cf675..19166adf0f 100755\n--- a/t/t2003-checkout-cache-mkdir.sh\n+++ b/t/t2003-checkout-cache-mkdir.sh\n@@ -24,27 +24,28 @@ test_expect_success SYMLINKS 'have symlink in place where dir is expected.' '\n \tmkdir path2 &&\n \tln -s path2 path1 &&\n \tgit checkout-index -f -a &&\n-\ttest ! -h path1 && test -d path1 &&\n-\ttest -f path1/file1 && test ! -f path2/file1\n+\ttest_path_is_dir_not_symlink path1 &&\n+\ttest_path_is_file path1/file1 &&\n+\ttest_path_is_missing path2/file1\n '\n \n test_expect_success 'use --prefix=path2/' '\n \trm -fr path0 path1 path2 &&\n \tmkdir path2 &&\n \tgit checkout-index --prefix=path2/ -f -a &&\n-\ttest -f path2/path0 &&\n-\ttest -f path2/path1/file1 &&\n-\ttest ! -f path0 &&\n-\ttest ! -f path1/file1\n+\ttest_path_is_file path2/path0 &&\n+\ttest_path_is_file path2/path1/file1 &&\n+\ttest_path_is_missing path0 &&\n+\ttest_path_is_missing path1/file1\n '\n \n test_expect_success 'use --prefix=tmp-' '\n \trm -fr path0 path1 path2 tmp* &&\n \tgit checkout-index --prefix=tmp- -f -a &&\n-\ttest -f tmp-path0 &&\n-\ttest -f tmp-path1/file1 &&\n-\ttest ! -f path0 &&\n-\ttest ! -f path1/file1\n+\ttest_path_is_file tmp-path0 &&\n+\ttest_path_is_file tmp-path1/file1 &&\n+\ttest_path_is_missing path0 &&\n+\ttest_path_is_missing path1/file1\n '\n \n test_expect_success 'use --prefix=tmp- but with a conflicting file and dir' '\n@@ -52,10 +53,10 @@ test_expect_success 'use --prefix=tmp- but with a conflicting file and dir' '\n \techo nitfol >tmp-path1 &&\n \tmkdir tmp-path0 &&\n \tgit checkout-index --prefix=tmp- -f -a &&\n-\ttest -f tmp-path0 &&\n-\ttest -f tmp-path1/file1 &&\n-\ttest ! -f path0 &&\n-\ttest ! -f path1/file1\n+\ttest_path_is_file tmp-path0 &&\n+\ttest_path_is_file tmp-path1/file1 &&\n+\ttest_path_is_missing path0 &&\n+\ttest_path_is_missing path1/file1\n '\n \n test_expect_success SYMLINKS 'use --prefix=tmp/orary/ where tmp is a symlink' '\n@@ -63,10 +64,10 @@ test_expect_success SYMLINKS 'use --prefix=tmp/orary/ where tmp is a symlink' '\n \tmkdir tmp1 tmp1/orary &&\n \tln -s tmp1 tmp &&\n \tgit checkout-index --prefix=tmp/orary/ -f -a &&\n-\ttest -d tmp1/orary &&\n-\ttest -f tmp1/orary/path0 &&\n-\ttest -f tmp1/orary/path1/file1 &&\n-\ttest -h tmp\n+\ttest_path_is_dir tmp1/orary &&\n+\ttest_path_is_file tmp1/orary/path0 &&\n+\ttest_path_is_file tmp1/orary/path1/file1 &&\n+\ttest_path_is_symlink tmp\n '\n \n test_expect_success SYMLINKS 'use --prefix=tmp/orary- where tmp is a symlink' '\n@@ -74,9 +75,9 @@ test_expect_success SYMLINKS 'use --prefix=tmp/orary- where tmp is a symlink' '\n \tmkdir tmp1 &&\n \tln -s tmp1 tmp &&\n \tgit checkout-index --prefix=tmp/orary- -f -a &&\n-\ttest -f tmp1/orary-path0 &&\n-\ttest -f tmp1/orary-path1/file1 &&\n-\ttest -h tmp\n+\ttest_path_is_file tmp1/orary-path0 &&\n+\ttest_path_is_file tmp1/orary-path1/file1 &&\n+\ttest_path_is_symlink tmp\n '\n \n test_expect_success SYMLINKS 'use --prefix=tmp- where tmp-path1 is a symlink' '\n@@ -84,10 +85,9 @@ test_expect_success SYMLINKS 'use --prefix=tmp- where tmp-path1 is a symlink' '\n \tmkdir tmp1 &&\n \tln -s tmp1 tmp-path1 &&\n \tgit checkout-index --prefix=tmp- -f -a &&\n-\ttest -f tmp-path0 &&\n-\ttest ! -h tmp-path1 &&\n-\ttest -d tmp-path1 &&\n-\ttest -f tmp-path1/file1\n+\ttest_path_is_file tmp-path0 &&\n+\ttest_path_is_dir_not_symlink tmp-path1 &&\n+\ttest_path_is_file tmp-path1/file1\n '\n \n test_expect_success 'apply filter from working tree .gitattributes with --prefix' '\n-- \n2.52.0\n\n"}]}