threads / patch / 65331

patcht/pack-refs-tests: drop '-f' from test_path_is_missing

Subject: [PATCH] t/pack-refs-tests: drop '-f' from test_path_is_missing

## tl;dr

One message between Mar 22, 2026 and Mar 22, 2026. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

jayesh0104· Mar 22, 2026, 10:56 UTC · lore

test_path_is_missing expects exactly one argument: the path to check for absence. Passing '-f' is incorrect and results in "bug in the test script: 1 param" during test execution.

The '-f' flag appears to have been carried over from the equivalent 'test -f' usage, but test_path_is_missing does not accept such flags.

Remove the extraneous '-f' to use the helper correctly and restore proper test behavior.

Signed-off-by: Jayesh Daga <jayeshdaga99@gmail.com>
---
 t/pack-refs-tests.sh | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
 mode change 100755 => 100644 t/pack-refs-tests.sh
Show changes to t/pack-refs-tests.sh +4 −14
diff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh
old mode 100755
new mode 100644
index fa27d43a58..4a85d96c6b
--- a/t/pack-refs-tests.sh
+++ b/t/pack-refs-tests.sh
@@ -1,9 +1,3 @@
-#!/bin/sh
-
-test_description='test pack-refs'
-
-. ./test-lib.sh
-
 pack_refs=${pack_refs:-pack-refs}
 
 test_expect_success 'enable reflogs' '
@@ -119,16 +113,14 @@ test_expect_success 'test excluded refs are not packed' '
 	git ${pack_refs} --all --exclude "refs/heads/dont_pack*" &&
 	test -f .git/refs/heads/dont_pack1 &&
 	test -f .git/refs/heads/dont_pack2 &&
-	! test -f .git/refs/heads/pack_this
-'
+	! test -f .git/refs/heads/pack_this'
 
 test_expect_success 'test --no-exclude refs clears excluded refs' '
 	git branch dont_pack3 &&
 	git branch dont_pack4 &&
 	git ${pack_refs} --all --exclude "refs/heads/dont_pack*" --no-exclude &&
 	! test -f .git/refs/heads/dont_pack3 &&
-	! test -f .git/refs/heads/dont_pack4
-'
+	! test -f .git/refs/heads/dont_pack4'
 
 test_expect_success 'test only included refs are packed' '
 	git branch pack_this1 &&
@@ -137,16 +129,14 @@ test_expect_success 'test only included refs are packed' '
 	git ${pack_refs} --include "refs/heads/pack_this*" &&
 	test -f .git/refs/tags/dont_pack5 &&
 	! test -f .git/refs/heads/pack_this1 &&
-	! test -f .git/refs/heads/pack_this2
-'
+	! test -f .git/refs/heads/pack_this2'
 
 test_expect_success 'test --no-include refs clears included refs' '
 	git branch pack1 &&
 	git branch pack2 &&
 	git ${pack_refs} --include "refs/heads/pack*" --no-include &&
 	test -f .git/refs/heads/pack1 &&
-	test -f .git/refs/heads/pack2
-'
+	test -f .git/refs/heads/pack2'
 
 test_expect_success 'test --exclude takes precedence over --include' '
 	git branch dont_pack5 &&
-- 
2.43.0

← back to recent threads