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

[PATCH] t0081: modernize the code testing whether a file exists

From
SGShashank S via GitGitGadget <gitgitgadget@gmail.com>
Date
Oct 14, 2026, 07:26 UTC
Message-ID
<pull.2254.git.1791962806807.gitgitgadget@gmail.com>
From: Shashank <shashu8660@gmail.com>

Replace the old-style shell `test -f` command with Git's modern `test_path_is_file`.

This instance was found using: `git grep "test -[efd]" t/'

Signed-off-by: Shashank <shashu8660@gmail.com>
---
    [outreachy] t0081: Replace the old style 'test -f' to new
    'test_path_is_file'
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2254%2Fshashu8660%2Fupdate-t0081-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2254/shashu8660/update-t0081-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2254
 t/t0081-find-pack.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t0081-find-pack.sh b/t/t0081-find-pack.sh
index ff9d56fbf1..7d5082c487 100755
--- a/t/t0081-find-pack.sh
+++ b/t/t0081-find-pack.sh
@@ -32,7 +32,7 @@ test_expect_success 'repack everything into a single packfile' '
 		".git/objects/pack/pack-"*".pack") true ;;
 		*) false ;;
 	esac &&
-	test -f "$head_commit_pack" &&
+	test_path_is_file "$head_commit_pack" &&
 
 	# Everything is in the same pack
 	test "$head_commit_pack" = "$head_tree_pack" &&

base-commit: 6de20f6092dcf9bdb1c8efe03db4b70c82b423dd
-- 
gitgitgadget
Next: Usman Akinyemi
Message 1 of 9 in “t0081: modernize the code testing whether a file exists”
  1. t0081: modernize the code testing whether a file existsShashank S via GitGitGadget, Oct 14, 2026
  2. Usman AkinyemiOct 14, 2026
  3. Junio C HamanoOct 14, 2026
  4. Shashank SOct 15, 2026
  5. Kaartic SivaraamOct 15, 2026
  6. Junio C HamanoOct 15, 2026
  7. Kaartic SivaraamOct 23, 2026
  8. Shashank SOct 15, 2026
  9. [Outreachy] t0081: modernize the code testing whether a file existsShashank S via GitGitGadget, Oct 15, 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.