git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] t/pack-refs-tests: use test_path_is_missing

From
Ritesh Singh Jadoun <riteshjd75@gmail.com>
Date
Mar 14, 2026, 03:46 UTC
Message-ID
<20260314034617.1261-1-riteshjd75@gmail.com>

The pack-refs tests currently use raw 'test -f' checks with negation. Update them to use Git's standard helper function test_path_is_missing for clearer failure reporting.

Signed-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>
---
 t/pack-refs-tests.sh | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh
index dca0c77ca1..3cc4906f05 100644
--- a/t/pack-refs-tests.sh
+++ b/t/pack-refs-tests.sh
@@ -61,7 +61,7 @@ test_expect_success 'see if a branch still exists after git ${pack_refs} --prune
 test_expect_success 'see if git ${pack_refs} --prune remove ref files' '
 	git branch f &&
 	git ${pack_refs} --all --prune &&
-	! test_path_is_file .git/refs/heads/f
+	test_path_is_missing .git/refs/heads/f
 '
 
 test_expect_success 'see if git ${pack_refs} --prune removes empty dirs' '
@@ -113,14 +113,14 @@ test_expect_success 'test excluded refs are not packed' '
 	git ${pack_refs} --all --exclude "refs/heads/dont_pack*" &&
 	test_path_is_file .git/refs/heads/dont_pack1 &&
 	test_path_is_file .git/refs/heads/dont_pack2 &&
-	! test_path_is_file .git/refs/heads/pack_this'
+	test_path_is_missing .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_path_is_file .git/refs/heads/dont_pack3 &&
-	! test_path_is_file .git/refs/heads/dont_pack4'
+	test_path_is_missing .git/refs/heads/dont_pack3 &&
+	test_path_is_missing .git/refs/heads/dont_pack4'
 
 test_expect_success 'test only included refs are packed' '
 	git branch pack_this1 &&
@@ -128,8 +128,8 @@ test_expect_success 'test only included refs are packed' '
 	git tag dont_pack5 &&
 	git ${pack_refs} --include "refs/heads/pack_this*" &&
 	test_path_is_file .git/refs/tags/dont_pack5 &&
-	! test_path_is_file .git/refs/heads/pack_this1 &&
-	! test_path_is_file .git/refs/heads/pack_this2'
+	test_path_is_missing .git/refs/heads/pack_this1 &&
+	test_path_is_missing .git/refs/heads/pack_this2'
 
 test_expect_success 'test --no-include refs clears included refs' '
 	git branch pack1 &&
@@ -147,7 +147,7 @@ test_expect_success 'see if up-to-date packed refs are preserved' '
 	git branch q &&
 	git ${pack_refs} --all --prune &&
 	git update-ref refs/heads/q refs/heads/q &&
-	! test_path_is_file .git/refs/heads/q
+	test_path_is_missing .git/refs/heads/q
 '
 
 test_expect_success 'pack, prune and repack' '
-- 
2.46.0.windows.1
Next: Junio C Hamano
Message 1 of 2 in “t/pack-refs-tests: use test_path_is_missing”
  1. t/pack-refs-tests: use test_path_is_missingRitesh Singh Jadoun, Mar 14, 2026
  2. Junio C HamanoMar 14, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.