threads / patch / 64711

patcht2021: use test helpers instead of shell primitives

Subject: [PATCH] t2021: use test helpers instead of shell primitives

## tl;dr

One message between Jan 2, 2026 and Jan 2, 2026. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

pushkarkumarsingh1970@gmail.com· Jan 2, 2026, 11:03 UTC · lore
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(-)
Show changes to t/t2021-checkout-overwrite.sh +2 −2
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

← back to recent threads