{"thread":{"id":"64759","subject":"[GSoC] t7101: modernize test path checks","startedAt":"2026-01-09T03:20:46Z","lastAt":"2026-01-09T11:24:28Z","messageCount":2,"participants":["K Jayatheerth","Pushkar Singh"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"533309","messageId":"20260109032027.68680-1-jayatheerthkulkarni2005@gmail.com","threadId":"64759","inReplyTo":null,"subject":"[GSoC] t7101: modernize test path checks","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2026-01-09T03:20:27Z","receivedAt":"2026-01-09T03:20:46Z","isPatch":false,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Replace old-style `test -[df]` and `! test -[df]` assertions with\nthe modern `test_path_is_file`, `test_path_is_dir`, and\n`test_path_is_missing` helpers.\n\nThese helpers provide more informative error messages in case of\nfailure (e.g., \"File 'foo' is missing\" instead of just exit code 1).\n\nWhile at it, fix a typo and an incorrect path\nreference in one of the test descriptions.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n t/t7101-reset-empty-subdirs.sh | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t7101-reset-empty-subdirs.sh b/t/t7101-reset-empty-subdirs.sh\nindex 33d5d5b76e..d1d3e231fc 100755\n--- a/t/t7101-reset-empty-subdirs.sh\n+++ b/t/t7101-reset-empty-subdirs.sh\n@@ -34,32 +34,32 @@ test_expect_success 'resetting tree HEAD^' '\n '\n \n test_expect_success 'checking initial files exist after rewind' '\n-\ttest -d path0 &&\n-\ttest -f path0/COPYING\n+\ttest_path_is_dir path0 &&\n+\ttest_path_is_file path0/COPYING\n '\n \n test_expect_success 'checking lack of path1/path2/COPYING' '\n-\t! test -f path1/path2/COPYING\n+\ttest_path_is_missing path1/path2/COPYING\n '\n \n test_expect_success 'checking lack of path1/COPYING' '\n-\t! test -f path1/COPYING\n+\ttest_path_is_missing path1/COPYING\n '\n \n test_expect_success 'checking lack of COPYING' '\n-\t! test -f COPYING\n+\ttest_path_is_missing COPYING\n '\n \n-test_expect_success 'checking checking lack of path1/COPYING-TOO' '\n-\t! test -f path0/COPYING-TOO\n+test_expect_success 'checking lack of path0/COPYING-TOO' '\n+\ttest_path_is_missing path0/COPYING-TOO\n '\n \n test_expect_success 'checking lack of path1/path2' '\n-\t! test -d path1/path2\n+\ttest_path_is_missing path1/path2\n '\n \n test_expect_success 'checking lack of path1' '\n-\t! test -d path1\n+\ttest_path_is_missing path1\n '\n \n test_done\n-- \n2.52.0\n\n"},{"id":"533335","messageId":"CALE2CrS0Q2NS1DbFv4pyRQsuypu=KH6Kurs=m4yWrFbR9QosoA@mail.gmail.com","threadId":"64759","inReplyTo":"20260109032027.68680-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [GSoC] t7101: modernize test path checks","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-01-09T11:24:14Z","receivedAt":"2026-01-09T11:24:28Z","isPatch":false,"sender":{"key":"pushkarkumarsingh1970@gmail.com","avatar":"https://avatars.githubusercontent.com/u/173247767?v=4"},"body":"Hi Jayatheerth,\n\nThanks for working on modernizing this test. Using the test_path_* helpers\nis definitely the right direction and makes failures much easier to\ndiagnose.\n\nI went through the patch and the conversions look correct:\n\n- test -d path0        -> test_path_is_dir path0\n- test -f path0/COPYING -> test_path_is_file path0/COPYING\n- ! test -f …          -> test_path_is_missing …\n\nall preserve the original intent of the checks while improving diagnostics.\n\nThe small cleanups are also helpful:\n- Fixing the duplicated “checking” in the test description.\n- Correcting the path from path1/COPYING-TOO to path0/COPYING-TOO so it\n  matches the actual tree being tested.\n\nI don’t see any semantic changes introduced here; this looks like a clean\nand safe modernization of the test.\n\nThanks for the patch.\n\nPushkar\n\nOn Fri, Jan 9, 2026 at 8:52 AM K Jayatheerth\n<jayatheerthkulkarni2005@gmail.com> wrote:\n>\n> Replace old-style `test -[df]` and `! test -[df]` assertions with\n> the modern `test_path_is_file`, `test_path_is_dir`, and\n> `test_path_is_missing` helpers.\n>\n> These helpers provide more informative error messages in case of\n> failure (e.g., \"File 'foo' is missing\" instead of just exit code 1).\n>\n> While at it, fix a typo and an incorrect path\n> reference in one of the test descriptions.\n>\n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  t/t7101-reset-empty-subdirs.sh | 18 +++++++++---------\n>  1 file changed, 9 insertions(+), 9 deletions(-)\n>\n> diff --git a/t/t7101-reset-empty-subdirs.sh b/t/t7101-reset-empty-subdirs.sh\n> index 33d5d5b76e..d1d3e231fc 100755\n> --- a/t/t7101-reset-empty-subdirs.sh\n> +++ b/t/t7101-reset-empty-subdirs.sh\n> @@ -34,32 +34,32 @@ test_expect_success 'resetting tree HEAD^' '\n>  '\n>\n>  test_expect_success 'checking initial files exist after rewind' '\n> -       test -d path0 &&\n> -       test -f path0/COPYING\n> +       test_path_is_dir path0 &&\n> +       test_path_is_file path0/COPYING\n>  '\n>\n>  test_expect_success 'checking lack of path1/path2/COPYING' '\n> -       ! test -f path1/path2/COPYING\n> +       test_path_is_missing path1/path2/COPYING\n>  '\n>\n>  test_expect_success 'checking lack of path1/COPYING' '\n> -       ! test -f path1/COPYING\n> +       test_path_is_missing path1/COPYING\n>  '\n>\n>  test_expect_success 'checking lack of COPYING' '\n> -       ! test -f COPYING\n> +       test_path_is_missing COPYING\n>  '\n>\n> -test_expect_success 'checking checking lack of path1/COPYING-TOO' '\n> -       ! test -f path0/COPYING-TOO\n> +test_expect_success 'checking lack of path0/COPYING-TOO' '\n> +       test_path_is_missing path0/COPYING-TOO\n>  '\n>\n>  test_expect_success 'checking lack of path1/path2' '\n> -       ! test -d path1/path2\n> +       test_path_is_missing path1/path2\n>  '\n>\n>  test_expect_success 'checking lack of path1' '\n> -       ! test -d path1\n> +       test_path_is_missing path1\n>  '\n>\n>  test_done\n> --\n> 2.52.0\n>\n>\n"}]}