aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoutrikDas <valusoutrik@gmail.com>2026-02-09 22:54:45 +0530
committerJunio C Hamano <gitster@pobox.com>2026-02-09 10:16:01 -0800
commitaaf3cc3d8dfb5357713ba9093f3eb51c72c66456 (patch)
tree75b9813c9c870b1218eab0c1a90ae46b99c5f66a
parent67ad42147a7acc2af6074753ebd03d904476118f (diff)
downloadgit-aaf3cc3d8dfb5357713ba9093f3eb51c72c66456.tar.xz
t7003: modernize path existence checks using test helpers
Replace direct uses of 'test -f' and 'test -d' with git's helper functions 'test_path_is_file' , 'test_path_is_missing' and 'test_path_is_dir' Signed-off-by: SoutrikDas <valusoutrik@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t7003-filter-branch.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 5ab4d41ee7..c475769858 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -92,8 +92,8 @@ test_expect_success 'rewrite, renaming a specific file' '
test_expect_success 'test that the file was renamed' '
test D = "$(git show HEAD:doh --)" &&
- ! test -f D.t &&
- test -f doh &&
+ test_path_is_missing D.t &&
+ test_path_is_file doh &&
test D = "$(cat doh)"
'
@@ -103,10 +103,10 @@ test_expect_success 'rewrite, renaming a specific directory' '
test_expect_success 'test that the directory was renamed' '
test dir/D = "$(git show HEAD:diroh/D.t --)" &&
- ! test -d dir &&
- test -d diroh &&
- ! test -d diroh/dir &&
- test -f diroh/D.t &&
+ test_path_is_missing dir &&
+ test_path_is_dir diroh &&
+ test_path_is_missing diroh/dir &&
+ test_path_is_file diroh/D.t &&
test dir/D = "$(cat diroh/D.t)"
'