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] t2021: use test helpers instead of shell primitives
Date: Fri,  2 Jan 2026 11:03:51 +0000	[thread overview]
Message-ID: <20260102110452.19221-1-pushkarkumarsingh1970@gmail.com> (raw)

From: Pushkar Singh <pushkarkumarsingh1970@gmail•com>

The tests here used plain `test -f` and `test -h` checks. Replacing them
with `test_path_is_file` and `test_path_is_symlink` makes failures easier
to understand and keeps the test style consistent with the rest of the
suite.

Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail•com>
---
 t/t2021-checkout-overwrite.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
index a5c03d5d4a..38c41ae373 100755
--- a/t/t2021-checkout-overwrite.sh
+++ b/t/t2021-checkout-overwrite.sh
@@ -27,7 +27,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
 	git rm --cached a/b &&
 	git commit -m "un-track the file" &&
 	test_must_fail git checkout start &&
-	test -f a/b
+	test_path_is_file a/b
 '
 
 test_expect_success 'create a commit where dir a/b changed to symlink' '
@@ -49,7 +49,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
 
 test_expect_success SYMLINKS 'the symlink remained' '
 
-	test -h a/b
+	test_path_is_symlink a/b
 '
 
 test_expect_success 'cleanup after previous symlink tests' '
-- 
2.43.0


                 reply	other threads:[~2026-01-02 11:05 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=20260102110452.19221-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