From: rimo <sampriyoguin@xxxxxxxxx> test -e changed to test_path_exists test -f changed to test_path_is_file Signed-off-by: Sampriyo Guin <sampriyoguin@xxxxxxxxx> --- [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@xxxxxxxxx , Christian Couder christian.couder@xxxxxxxxx, Ghanshyam Thakkar shyamthakkar001@xxxxxxxxx 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