{"thread":{"id":"66601","subject":"[PATCH] t5301: use test_path_is_file instead of test -f","startedAt":"2026-10-20T09:26:27Z","lastAt":"2026-10-21T16:00:58Z","messageCount":2,"participants":["Roger Koranteng via GitGitGadget","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"555517","messageId":"pull.2269.git.1792488388022.gitgitgadget@gmail.com","threadId":"66601","inReplyTo":null,"subject":"[PATCH] t5301: use test_path_is_file instead of test -f","fromName":"Roger Koranteng via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-10-20T09:26:27Z","receivedAt":"2026-10-20T09:26:27Z","isPatch":true,"sender":{"key":"name:Roger Koranteng","avatar":null},"body":"From: Roger Koranteng <rogerkorantenng@gmail.com>\n\nReplace raw 'test -f' assertions with the 'test_path_is_file' helper,\nwhich gives diagnostic output when the assertion fails.\n\nSigned-off-by: Roger Koranteng <rogerkorantenng@gmail.com>\n---\n    t5301: use test_path_is_file instead of test -f\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2269%2Frogerkorantenng%2Ft5301-modernize-path-checks-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2269/rogerkorantenng/t5301-modernize-path-checks-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2269\n\n t/t5301-sliding-window.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\nindex 3c3666b278..b6868229bf 100755\n--- a/t/t5301-sliding-window.sh\n+++ b/t/t5301-sliding-window.sh\n@@ -22,7 +22,7 @@ test_expect_success 'setup' '\n \tgit repack -a -d &&\n \ttest \"$(git count-objects)\" = \"0 objects, 0 kilobytes\" &&\n \tpack1=$(ls .git/objects/pack/*.pack) &&\n-\ttest -f \"$pack1\"\n+\ttest_path_is_file \"$pack1\"\n '\n \n test_expect_success 'verify-pack -v, defaults' '\n@@ -48,7 +48,7 @@ test_expect_success 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' '\n \tgit repack -a -d &&\n \ttest \"$(git count-objects)\" = \"0 objects, 0 kilobytes\" &&\n \tpack2=$(ls .git/objects/pack/*.pack) &&\n-\ttest -f \"$pack2\" &&\n+\ttest_path_is_file \"$pack2\" &&\n \ttest \"$pack1\" \\!= \"$pack2\"\n '\n \n\nbase-commit: c51408889c3b372814bc20b9431c3b74d0d268eb\n-- \ngitgitgadget\n\n"},{"id":"555751","messageId":"xmqqse1zqc05.fsf@gitster.g","threadId":"66601","inReplyTo":"pull.2269.git.1792488388022.gitgitgadget@gmail.com","subject":"Re: [PATCH] t5301: use test_path_is_file instead of test -f","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-21T16:00:58Z","receivedAt":"2026-10-21T16:00:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Roger Koranteng via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Roger Koranteng <rogerkorantenng@gmail.com>\n>\n> Replace raw 'test -f' assertions with the 'test_path_is_file' helper,\n> which gives diagnostic output when the assertion fails.\n>\n> Signed-off-by: Roger Koranteng <rogerkorantenng@gmail.com>\n> ---\n>     t5301: use test_path_is_file instead of test -f\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2269%2Frogerkorantenng%2Ft5301-modernize-path-checks-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2269/rogerkorantenng/t5301-modernize-path-checks-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/2269\n>\n>  t/t5301-sliding-window.sh | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh\n> index 3c3666b278..b6868229bf 100755\n> --- a/t/t5301-sliding-window.sh\n> +++ b/t/t5301-sliding-window.sh\n> @@ -22,7 +22,7 @@ test_expect_success 'setup' '\n>  \tgit repack -a -d &&\n>  \ttest \"$(git count-objects)\" = \"0 objects, 0 kilobytes\" &&\n>  \tpack1=$(ls .git/objects/pack/*.pack) &&\n> -\ttest -f \"$pack1\"\n> +\ttest_path_is_file \"$pack1\"\n>  '\n\nOK.\n\n>  test_expect_success 'verify-pack -v, defaults' '\n> @@ -48,7 +48,7 @@ test_expect_success 'repack -a -d, packedGit{WindowSize,Limit} == 1 page' '\n>  \tgit repack -a -d &&\n>  \ttest \"$(git count-objects)\" = \"0 objects, 0 kilobytes\" &&\n>  \tpack2=$(ls .git/objects/pack/*.pack) &&\n> -\ttest -f \"$pack2\" &&\n> +\ttest_path_is_file \"$pack2\" &&\n\nOK.\n\n>  \ttest \"$pack1\" \\!= \"$pack2\"\n>  '\n\nThis is an existing wart but we shouldn't quote letters that we do\nnot have to quote like this.  It gives a wrong hint to readers that\nsomething fishy might be going on and distracts them.  We may want\nto have a separate job to find warts in tests similar to this one\nand eradicate them all, but that is totally outside the scope of\nthis patch.\n\nLooking good to me.\n\n\n\n"}]}