t1300: use test helpers instead of `test` command
Replace `test -f` and `test -h` checks with `test_path_is_file` and `test_path_is_symlink`. Using the test framework helpers provides clearer diagnostics and keeps tests consistent across the suite. Signed-off-by: Pushkar Singh <pushkarkumarsingh1970@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Pushkar Singh committed
Jan 4, 2026 at 19:47 UTC
404b6772297c77f48de298adf11ab94f080eba72
2 files changed
+6
-6
t/t1300-config.sh
+4
-4
@@ -1232,12 +1232,12 @@ test_expect_success SYMLINKS 'symlinked configuration' '
1232
test_when_finished "rm myconfig" &&
1233
ln -s notyet myconfig &&
1234
git config --file=myconfig test.frotz nitfol &&
1235
- test -h myconfig &&
1236
- test -f notyet &&
1235
+ test_path_is_symlink myconfig &&
1236
+ test_path_is_file notyet &&
1237
test "z$(git config --file=notyet test.frotz)" = znitfol &&
1238
git config --file=myconfig test.xyzzy rezrov &&
1239
- test -h myconfig &&
1240
- test -f notyet &&
1239
+ test_path_is_symlink myconfig &&
1240
+ test_path_is_file notyet &&
1241
cat >expect <<-\EOF &&
1242
nitfol
1243
rezrov
t/t2021-checkout-overwrite.sh
+2
-2
@@ -27,7 +27,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '
27
git rm --cached a/b &&
28
git commit -m "un-track the file" &&
29
test_must_fail git checkout start &&
30
- test -f a/b
30
+ test_path_is_file a/b
31
'
32
33
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' '
49
50
test_expect_success SYMLINKS 'the symlink remained' '
51
52
- test -h a/b
52
+ test_path_is_symlink a/b
53
'
54
55
test_expect_success 'cleanup after previous symlink tests' '