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>
SoutrikDas committed
Feb 9, 2026 at 22:54 UTC
aaf3cc3d8dfb5357713ba9093f3eb51c72c66456
1 file changed
+6
-6
t/t7003-filter-branch.sh
+6
-6
@@ -92,8 +92,8 @@ test_expect_success 'rewrite, renaming a specific file' '
92
93
test_expect_success 'test that the file was renamed' '
94
test D = "$(git show HEAD:doh --)" &&
95
- ! test -f D.t &&
96
- test -f doh &&
95
+ test_path_is_missing D.t &&
96
+ test_path_is_file doh &&
97
test D = "$(cat doh)"
98
'
99
@@ -103,10 +103,10 @@ test_expect_success 'rewrite, renaming a specific directory' '
103
104
test_expect_success 'test that the directory was renamed' '
105
test dir/D = "$(git show HEAD:diroh/D.t --)" &&
106
- ! test -d dir &&
107
- test -d diroh &&
108
- ! test -d diroh/dir &&
109
- test -f diroh/D.t &&
106
+ test_path_is_missing dir &&
107
+ test_path_is_dir diroh &&
108
+ test_path_is_missing diroh/dir &&
109
+ test_path_is_file diroh/D.t &&
110
test dir/D = "$(cat diroh/D.t)"
111
'
112