public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: pushkarkumarsingh1970@gmail•com
To: git@vger•kernel.org
Cc: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
Subject: [PATCH v2] t1300: use test helpers instead of shell primitives
Date: Fri,  2 Jan 2026 09:46:55 +0000	[thread overview]
Message-ID: <20260102095248.18780-1-pushkarkumarsingh1970@gmail.com> (raw)

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


                 reply	other threads:[~2026-01-02  9:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260102095248.18780-1-pushkarkumarsingh1970@gmail.com \
    --to=pushkarkumarsingh1970@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox