git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [GSoC Patch] Modernize Test Path Checking: test -(e|f|d)
@ 2025-03-18 11:58 Sampriyo Guin via GitGitGadget
  2025-03-18 17:39 ` Eric Sunshine
  0 siblings, 1 reply; 5+ messages in thread
From: Sampriyo Guin via GitGitGadget @ 2025-03-18 11:58 UTC (permalink / raw)
  To: git; +Cc: Patrick Steinhardt, Karthik Nayak, Sampriyo Guin, rimo

From: rimo <sampriyoguin@gmail.com>

test -e changed to test_path_exists
test -f changed to test_path_is_file

Signed-off-by: Sampriyo Guin <sampriyoguin@gmail.com>
---
    [GSoC Patch] Modernize Test Path Checking in Git’s Test Suite
    
    This is my first git contribution. A simple fix as specified in Git
    Microprojects. I have tested using Github Actions on my private
    repository. Your comments and feedbacks are much appreciated. Thanks!
    
    , Jialuo She shejialuo@gmail.com , Christian Couder
    christian.couder@gmail.com, Ghanshyam Thakkar shyamthakkar001@gmail.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1918%2FRimoGuin%2Fmaster-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1918/RimoGuin/master-v1
Pull-Request: https://github.com/git/git/pull/1918

 t/chainlint/chained-subshell.expect | 2 +-
 t/chainlint/chained-subshell.test   | 2 +-
 t/chainlint/function.expect         | 2 +-
 t/chainlint/function.test           | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/chainlint/chained-subshell.expect b/t/chainlint/chained-subshell.expect
index 93fb1a6578b..76393efcd20 100644
--- a/t/chainlint/chained-subshell.expect
+++ b/t/chainlint/chained-subshell.expect
@@ -5,6 +5,6 @@
 6 ) &&
 7 
 8 cut "-d " -f actual | (read s1 s2 s3 &&
-9 test -f $s1 ?!LINT: missing '&&'?!
+9 test_path_is_file $s1 ?!LINT: missing '&&'?!
 10 test $(cat $s2) = tree2path1 &&
 11 test $(cat $s3) = tree3path1)
diff --git a/t/chainlint/chained-subshell.test b/t/chainlint/chained-subshell.test
index 1f11f653982..997f30eadd7 100644
--- a/t/chainlint/chained-subshell.test
+++ b/t/chainlint/chained-subshell.test
@@ -8,7 +8,7 @@ mkdir sub && (
 
 # LINT: preceding command pipes to subshell on same line
 cut "-d " -f actual | (read s1 s2 s3 &&
-test -f $s1
+test_path_is_file $s1
 test $(cat $s2) = tree2path1 &&
 # LINT: closing subshell ")" correctly detected on same line as "$(...)"
 test $(cat $s3) = tree3path1)
diff --git a/t/chainlint/function.expect b/t/chainlint/function.expect
index 9e46a3554a1..2edbeb5e4e2 100644
--- a/t/chainlint/function.expect
+++ b/t/chainlint/function.expect
@@ -4,7 +4,7 @@
 5 
 6 remove_object() {
 7 	file=$(sha1_file "$*") &&
-8 	test -e "$file" ?!LINT: missing '&&'?!
+8 	test_path_exists "$file" ?!LINT: missing '&&'?!
 9 	rm -f "$file"
 10 } ?!LINT: missing '&&'?!
 11 
diff --git a/t/chainlint/function.test b/t/chainlint/function.test
index 763fcf3f878..2f2a5c251f4 100644
--- a/t/chainlint/function.test
+++ b/t/chainlint/function.test
@@ -7,7 +7,7 @@ sha1_file() {
 # LINT: broken &&-chain in function and after function
 remove_object() {
 	file=$(sha1_file "$*") &&
-	test -e "$file"
+	test_path_exists "$file"
 	rm -f "$file"
 }
 

base-commit: 683c54c999c301c2cd6f715c411407c413b1d84e
-- 
gitgitgadget

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

end of thread, other threads:[~2025-03-24 14:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 11:58 [PATCH] [GSoC Patch] Modernize Test Path Checking: test -(e|f|d) Sampriyo Guin via GitGitGadget
2025-03-18 17:39 ` Eric Sunshine
2025-03-18 19:34   ` Junio C Hamano
2025-03-18 21:36     ` Eric Sunshine
2025-03-24 14:23       ` Karthik Nayak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).