{"thread":{"id":"65332","subject":"[PATCH 0/2] t/pack-refs-tests: fix helper usage","startedAt":"2026-03-22T12:46:31Z","lastAt":"2026-03-22T13:29:34Z","messageCount":4,"participants":["Jayesh Daga via GitGitGadget","jayesh0104 via GitGitGadget","K Jayatheerth"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"539642","messageId":"pull.2247.git.git.1774183586.gitgitgadget@gmail.com","threadId":"65332","inReplyTo":null,"subject":"[PATCH 0/2] t/pack-refs-tests: fix helper usage","fromName":"Jayesh Daga via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-03-22T12:46:24Z","receivedAt":"2026-03-22T12:46:31Z","isPatch":true,"sender":{"key":"jayeshdaga99@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86013121?v=4"},"body":"\nHigh-level (Intent & Context)\n=============================\n\nThe test script t/pack-refs-tests.sh has two issues that prevent it from\nrunning correctly.\n\nIt uses: ! test -f .git/refs/heads/f\n\nThis is inconsistent with the Git test framework, where helper functions\nsuch as test_path_is_missing should be used instead of raw test checks.\n\n\nLow-level (Implementation & Justification)\n==========================================\n\nWithout sourcing test-lib.sh, the test framework is not initialized, leading\nto errors such as: test_expect_success: not found\n\n * Replaced raw file check with the appropriate helper:\n\n- ! test -f .git/refs/heads/f\n+ test_path_is_missing .git/refs/heads/f\n\n\nSummary\n\n * Replace test -f with test_path_is_missing\n\njayesh0104 (2):\n  t/pack-refs-tests: drop '-f' from test_path_is_missing\n  t/pack-refs-tests: drop '-f' from test_path_is_missing\n\n t/pack-refs-tests.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: 6e8d538aab8fe4dd07ba9fb87b5c7edcfa5706ad\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2247%2Fjayesh0104%2Ffix-pack-refs-test-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2247/jayesh0104/fix-pack-refs-test-v1\nPull-Request: https://github.com/git/git/pull/2247\n-- \ngitgitgadget\n"},{"id":"539643","messageId":"d9fff1ad4effb57fc0c814bee7b33c84ee40f7ca.1774183586.git.gitgitgadget@gmail.com","threadId":"65332","inReplyTo":"pull.2247.git.git.1774183586.gitgitgadget@gmail.com","subject":"[PATCH 1/2] t/pack-refs-tests: drop '-f' from test_path_is_missing","fromName":"jayesh0104 via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-03-22T12:46:25Z","receivedAt":"2026-03-22T12:46:35Z","isPatch":true,"sender":{"key":"jayeshdaga99@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86013121?v=4"},"body":"From: jayesh0104 <jayeshdaga99@gmail.com>\n\ntest_path_is_missing expects exactly one argument: the path to\ncheck for absence. Passing '-f' is incorrect and results in\n\"bug in the test script: 1 param\" during test execution.\n\nThe '-f' flag appears to have been carried over from the\nequivalent 'test -f' usage, but test_path_is_missing does not\naccept such flags.\n\nRemove the extraneous '-f' to use the helper correctly and\nrestore proper test behavior.\n\nSigned-off-by: Jayesh Daga <jayeshdaga99@gmail.com>\n---\n t/pack-refs-tests.sh | 8 +++++++-\n 1 file changed, 7 insertions(+), 1 deletion(-)\n mode change 100644 => 100755 t/pack-refs-tests.sh\n\ndiff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh\nold mode 100644\nnew mode 100755\nindex 2fdaccb6c7..8a0c955647\n--- a/t/pack-refs-tests.sh\n+++ b/t/pack-refs-tests.sh\n@@ -1,3 +1,9 @@\n+#!/bin/sh\n+\n+test_description='test pack-refs'\n+\n+. ./test-lib.sh\n+\n pack_refs=${pack_refs:-pack-refs}\n \n test_expect_success 'enable reflogs' '\n@@ -61,7 +67,7 @@ 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-- \ngitgitgadget\n\n"},{"id":"539644","messageId":"6f71fb3e9a39d8cec62bbbc83e53543be40feef1.1774183586.git.gitgitgadget@gmail.com","threadId":"65332","inReplyTo":"pull.2247.git.git.1774183586.gitgitgadget@gmail.com","subject":"[PATCH 2/2] t/pack-refs-tests: drop '-f' from test_path_is_missing","fromName":"jayesh0104 via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-03-22T12:46:26Z","receivedAt":"2026-03-22T12:46:35Z","isPatch":true,"sender":{"key":"jayeshdaga99@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86013121?v=4"},"body":"From: jayesh0104 <jayeshdaga99@gmail.com>\n\ntest_path_is_missing expects exactly one argument: the path to\ncheck for absence. Passing '-f' is incorrect and results in\n\"bug in the test script: 1 param\" during test execution.\n\nThe '-f' flag appears to have been carried over from the\nequivalent 'test -f' usage, but test_path_is_missing does not\naccept such flags.\n\nRemove the extraneous '-f' to use the helper correctly and\nrestore proper test behavior.\n\nSigned-off-by: Jayesh Daga <jayeshdaga99@gmail.com>\n---\n t/pack-refs-tests.sh | 6 ------\n 1 file changed, 6 deletions(-)\n mode change 100755 => 100644 t/pack-refs-tests.sh\n\ndiff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh\nold mode 100755\nnew mode 100644\nindex 8a0c955647..4a85d96c6b\n--- a/t/pack-refs-tests.sh\n+++ b/t/pack-refs-tests.sh\n@@ -1,9 +1,3 @@\n-#!/bin/sh\n-\n-test_description='test pack-refs'\n-\n-. ./test-lib.sh\n-\n pack_refs=${pack_refs:-pack-refs}\n \n test_expect_success 'enable reflogs' '\n-- \ngitgitgadget\n"},{"id":"539645","messageId":"CA+rGoLd71J31P98_4jC94Zo+oN6qk2ZX65wnOHU=xPwthhWpqQ@mail.gmail.com","threadId":"65332","inReplyTo":"6f71fb3e9a39d8cec62bbbc83e53543be40feef1.1774183586.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 2/2] t/pack-refs-tests: drop '-f' from test_path_is_missing","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2026-03-22T13:29:22Z","receivedAt":"2026-03-22T13:29:34Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Hi Jayesh,\nThanks for the patch\n\nIt is a textbook micro project ;)\nBut I could find a few flaws in it.\n\n\n> test_path_is_missing expects exactly one argument: the path to\n> --- a/t/pack-refs-tests.sh\n> +++ b/t/pack-refs-tests.sh\n> @@ -1,9 +1,3 @@\n> -#!/bin/sh\n> -\n> -test_description='test pack-refs'\n> -\n> -. ./test-lib.sh\n> -\n>  pack_refs=${pack_refs:-pack-refs}\n>\n>  test_expect_success 'enable reflogs' '\n> --\n> gitgitgadget\n\n\nPatch 2 removes exactly what Patch 1 adds.\nYou'll have to use rebase -i\ni.e interactive rebase\nand change em.\n\nHere are some docs [1]\n\nRegards,\n- Jayatheerth\n\n\n1 - https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History\n"}]}