public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [GSOC PATCH] t7003: modernize path existence checks using test helpers
@ 2026-02-09 17:24 SoutrikDas
  2026-02-09 18:11 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: SoutrikDas @ 2026-02-09 17:24 UTC (permalink / raw)
  To: git; +Cc: SoutrikDas

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>
---
 t/t7003-filter-branch.sh | 12 ++++++------
 1 file 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)"
 '
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-02-10 18:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 17:24 [GSOC PATCH] t7003: modernize path existence checks using test helpers SoutrikDas
2026-02-09 18:11 ` Junio C Hamano
2026-02-10 18:14   ` SoutrikDas
2026-02-10 18:41     ` [GSOC PATCH v2] " SoutrikDas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox