{"thread":{"id":"65251","subject":"[PATCH v2] t/pack-refs-tests: use test_path_is_missing","startedAt":"2026-03-15T08:11:03Z","lastAt":"2026-03-16T15:25:53Z","messageCount":2,"participants":["Ritesh Singh Jadoun","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"539015","messageId":"20260315081032.497-1-riteshjd75@gmail.com","threadId":"65251","inReplyTo":null,"subject":"[PATCH v2] t/pack-refs-tests: use test_path_is_missing","fromName":"Ritesh Singh Jadoun","fromEmail":"riteshjd75@gmail.com","sentAt":"2026-03-15T08:10:32Z","receivedAt":"2026-03-15T08:11:03Z","isPatch":true,"sender":{"key":"riteshjd75@gmail.com","avatar":"https://avatars.githubusercontent.com/u/181055371?v=4"},"body":"The pack-refs tests previously used raw 'test -f' and 'test -e' checks\nwith negation. Update them to use Git's standard helper function\ntest_path_is_missing for consistency and clearer failure reporting.\n\nAs suggested in review, replaced the negated 'test_path_exists' with\ntest_path_is_missing to better reflect the expected absence of paths.\n\nSigned-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>\n---\n t/pack-refs-tests.sh | 28 ++++++++++++++--------------\n 1 file changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh\nindex 2fdaccb6c7..d76b087b09 100644\n--- a/t/pack-refs-tests.sh\n+++ b/t/pack-refs-tests.sh\n@@ -61,13 +61,13 @@ test_expect_success 'see if a branch still exists after git ${pack_refs} --prune\n test_expect_success 'see if git ${pack_refs} --prune remove ref files' '\n \tgit branch f &&\n \tgit ${pack_refs} --all --prune &&\n-\t! test -f .git/refs/heads/f\n+\ttest_path_is_missing .git/refs/heads/f\n '\n \n test_expect_success 'see if git ${pack_refs} --prune removes empty dirs' '\n \tgit branch r/s/t &&\n \tgit ${pack_refs} --all --prune &&\n-\t! test -e .git/refs/heads/r\n+\ttest_path_is_missing .git/refs/heads/r\n '\n \n test_expect_success 'git branch g should work when git branch g/h has been deleted' '\n@@ -111,43 +111,43 @@ test_expect_success 'test excluded refs are not packed' '\n \tgit branch dont_pack2 &&\n \tgit branch pack_this &&\n \tgit ${pack_refs} --all --exclude \"refs/heads/dont_pack*\" &&\n-\ttest -f .git/refs/heads/dont_pack1 &&\n-\ttest -f .git/refs/heads/dont_pack2 &&\n-\t! test -f .git/refs/heads/pack_this'\n+\ttest_path_is_file .git/refs/heads/dont_pack1 &&\n+\ttest_path_is_file .git/refs/heads/dont_pack2 &&\n+\ttest_path_is_missing .git/refs/heads/pack_this'\n \n test_expect_success 'test --no-exclude refs clears excluded refs' '\n \tgit branch dont_pack3 &&\n \tgit branch dont_pack4 &&\n \tgit ${pack_refs} --all --exclude \"refs/heads/dont_pack*\" --no-exclude &&\n-\t! test -f .git/refs/heads/dont_pack3 &&\n-\t! test -f .git/refs/heads/dont_pack4'\n+\ttest_path_is_missing .git/refs/heads/dont_pack3 &&\n+\ttest_path_is_missing .git/refs/heads/dont_pack4'\n \n test_expect_success 'test only included refs are packed' '\n \tgit branch pack_this1 &&\n \tgit branch pack_this2 &&\n \tgit tag dont_pack5 &&\n \tgit ${pack_refs} --include \"refs/heads/pack_this*\" &&\n-\ttest -f .git/refs/tags/dont_pack5 &&\n-\t! test -f .git/refs/heads/pack_this1 &&\n-\t! test -f .git/refs/heads/pack_this2'\n+\ttest_path_is_file .git/refs/tags/dont_pack5 &&\n+\ttest_path_is_missing .git/refs/heads/pack_this1 &&\n+\ttest_path_is_missing .git/refs/heads/pack_this2'\n \n test_expect_success 'test --no-include refs clears included refs' '\n \tgit branch pack1 &&\n \tgit branch pack2 &&\n \tgit ${pack_refs} --include \"refs/heads/pack*\" --no-include &&\n-\ttest -f .git/refs/heads/pack1 &&\n-\ttest -f .git/refs/heads/pack2'\n+\ttest_path_is_file .git/refs/heads/pack1 &&\n+\ttest_path_is_file .git/refs/heads/pack2'\n \n test_expect_success 'test --exclude takes precedence over --include' '\n \tgit branch dont_pack5 &&\n \tgit ${pack_refs} --include \"refs/heads/pack*\" --exclude \"refs/heads/pack*\" &&\n-\ttest -f .git/refs/heads/dont_pack5'\n+\ttest_path_is_file .git/refs/heads/dont_pack5'\n \n test_expect_success 'see if up-to-date packed refs are preserved' '\n \tgit branch q &&\n \tgit ${pack_refs} --all --prune &&\n \tgit update-ref refs/heads/q refs/heads/q &&\n-\t! test -f .git/refs/heads/q\n+\ttest_path_is_missing .git/refs/heads/q\n '\n \n test_expect_success 'pack, prune and repack' '\n-- \n2.46.0.windows.1\n\n"},{"id":"539111","messageId":"xmqqa4w7re2p.fsf@gitster.g","threadId":"65251","inReplyTo":"20260315081032.497-1-riteshjd75@gmail.com","subject":"Re: [PATCH v2] t/pack-refs-tests: use test_path_is_missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-16T15:25:50Z","receivedAt":"2026-03-16T15:25:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ritesh Singh Jadoun <riteshjd75@gmail.com> writes:\n\n> The pack-refs tests previously used raw 'test -f' and 'test -e' checks\n> with negation. Update them to use Git's standard helper function\n> test_path_is_missing for consistency and clearer failure reporting.\n>\n> As suggested in review, replaced the negated 'test_path_exists' with\n> test_path_is_missing to better reflect the expected absence of paths.\n>\n> Signed-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>\n> ---\n>  t/pack-refs-tests.sh | 28 ++++++++++++++--------------\n>  1 file changed, 14 insertions(+), 14 deletions(-)\n\nThis round looks very good.  Thanks.  Will queue.\n"}]}