]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1300: use test helpers instead of `test` command
authorPushkar Singh <pushkarkumarsingh1970@gmail.com>
Sun, 4 Jan 2026 19:47:59 +0000 (19:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Jan 2026 01:58:58 +0000 (10:58 +0900)
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>
t/t1300-config.sh
t/t2021-checkout-overwrite.sh

index 358d6363796f48c8c39c89c8a7ea6f589bc02fb8..9850fcd5b567a51c5f4edb6c7550597de3b62dcb 100755 (executable)
@@ -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
index a5c03d5d4a2c5a31a8e921fc81344d9470dd79bb..38c41ae37321cee1428065bc9f8766c414e2b9ad 100755 (executable)
@@ -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' '