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

[PATCH v3] [Outreachy PATCH] t2030: modernize test path checks

From
SGSrujith A Poojary via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 18, 2026, 05:05 UTC
Message-ID
<pull.2256.v3.git.1792299943380.gitgitgadget@gmail.com>
In-Reply-To
<pull.2256.git.1791978767497.gitgitgadget@gmail.com>
From: Srujith Poojary <poojarysrujith@gmail.com>
Replace old-style file checks with test_path_is_file and the helper
test_path_is_missing for clearer failure diagnostics in test output.
Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
---
    t2030: modernize test path checks
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2256%2Fpoojarysrujith%2Fmicroproject-modernize-path-check-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2256/poojarysrujith/microproject-modernize-path-check-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2256
Range-diff vs v2:
 1:  93cf6c12f4 ! 1:  75086e1db0 [Outreachy PATCH] t2030: modernize test path checks
     @@ Commit message
      
          test_path_is_missing for clearer failure diagnostics in test output.
      
     -    Search with: git grep "test -[efd]" t/
     -
          Signed-off-by: Srujith Poojary <poojarysrujith@gmail.com>
      
       ## t/t2030-unresolve-info.sh ##
     @@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget' '
       	tr "\0" "\n" <.git/MERGE_RR >actual &&
       	echo "$rerere_id	fi/le" >expect &&
       	test_cmp expect actual
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	(cd fi && git rerere) &&
     + 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
     + 	rerere_id=${rerere_id%/postimage} &&
     +-	test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
     + 	(cd fi && git checkout -m le) &&
     + 	echo resurrect the conflict &&
     + 	test_grep "^=======" fi/le &&
     +@@ t/t2030-unresolve-info.sh: test_expect_success 'rerere and rerere forget (subdirectory)' '
     + 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
     + 	test -z "$(git ls-files -u)" &&
     + 	(cd fi && git rerere forget le) &&
     +-	! test -f .git/rr-cache/$rerere_id/postimage &&
     ++	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
     + 	tr "\0" "\n" <.git/MERGE_RR >actual &&
     + 	echo "$rerere_id	fi/le" >expect &&
     + 	test_cmp expect actual
 t/t2030-unresolve-info.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t2030-unresolve-info.sh b/t/t2030-unresolve-info.sh
index 9af24b1204..f6f5dd7cb8 100755
--- a/t/t2030-unresolve-info.sh
+++ b/t/t2030-unresolve-info.sh
@@ -170,7 +170,7 @@ test_expect_success 'rerere and rerere forget' '
 	git rerere &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	git checkout -m fi/le &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -182,7 +182,7 @@ test_expect_success 'rerere and rerere forget' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	git rerere forget fi/le &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual
@@ -196,7 +196,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	(cd fi && git rerere) &&
 	rerere_id=$(cd .git/rr-cache && echo */postimage) &&
 	rerere_id=${rerere_id%/postimage} &&
-	test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_file .git/rr-cache/$rerere_id/postimage &&
 	(cd fi && git checkout -m le) &&
 	echo resurrect the conflict &&
 	test_grep "^=======" fi/le &&
@@ -208,7 +208,7 @@ test_expect_success 'rerere and rerere forget (subdirectory)' '
 	check_resolve_undo kept fi/le initial:fi/le second:fi/le third:fi/le &&
 	test -z "$(git ls-files -u)" &&
 	(cd fi && git rerere forget le) &&
-	! test -f .git/rr-cache/$rerere_id/postimage &&
+	test_path_is_missing .git/rr-cache/$rerere_id/postimage &&
 	tr "\0" "\n" <.git/MERGE_RR >actual &&
 	echo "$rerere_id	fi/le" >expect &&
 	test_cmp expect actual

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget
Previous: Usman Akinyemi
Message 8 of 8 in “t2030: modernize test path checks”
  1. t2030: modernize test path checksSrujith A Poojary via GitGitGadget, Oct 14, 2026
  2. [Outreachy PATCH] t2030: modernize test path checksSrujith A Poojary via GitGitGadget, Oct 16, 2026
  3. Harald NordgrenOct 16, 2026
  4. Srujith PoojaryOct 16, 2026
  5. Usman AkinyemiOct 16, 2026
  6. Srujith PoojaryOct 16, 2026
  7. Usman AkinyemiOct 16, 2026
  8. [Outreachy PATCH] t2030: modernize test path checksSrujith A Poojary via GitGitGadget, Oct 18, 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.