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

[PATCH v2] t1300: use test helpers instead of shell primitives

From
pushkarkumarsingh1970@gmail.com <pushkarkumarsingh1970@gmail.com>
Date
Jan 2, 2026, 09:46 UTC
Message-ID
<20260102095248.18780-1-pushkarkumarsingh1970@gmail.com>
From: Pushkar Singh <pushkarkumarsingh1970@gmail.com>

Replace plain "test -f" (regular file checks) with "test_path_is_file" and "test -h" (symbolic link checks) with "test_path_is_symlink". The test framework helpers provide clearer diagnostics and better consistency across the test suite.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com>
---
v2: expand commit message to clarify that
	- test -f checks regular files
	- test -h checks symbolic links
 t/t1300-config.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t1300-config.sh b/t/t1300-config.sh
index 358d636379..9850fcd5b5 100755
--- a/t/t1300-config.sh
+++ b/t/t1300-config.sh
@@ -1232,12 +1232,12 @@ test_expect_success SYMLINKS 'symlinked configuration' '
 	test_when_finished "rm myconfig" &&
 	ln -s notyet myconfig &&
 	git config --file=myconfig test.frotz nitfol &&
-	test -h myconfig &&
-	test -f notyet &&
+	test_path_is_symlink myconfig &&
+	test_path_is_file notyet &&
 	test "z$(git config --file=notyet test.frotz)" = znitfol &&
 	git config --file=myconfig test.xyzzy rezrov &&
-	test -h myconfig &&
-	test -f notyet &&
+	test_path_is_symlink myconfig &&
+	test_path_is_file notyet &&
 	cat >expect <<-\EOF &&
 	nitfol
 	rezrov
-- 
2.43.0
Message 1 of 1 in “t1300: use test helpers instead of shell primitives”
  1. t1300: use test helpers instead of shell primitivespushkarkumarsingh1970@gmail.com, Jan 2, 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.