From: Tilak Kumar <raaztilak07@gmail.com>
To: git@vger.kernel.org
Cc: Tilak Kumar <raaztilak07@gmail.com>
Subject: [GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f
Date: Fri, 30 Oct 2026 01:30:24 +0530 [thread overview]
Message-ID: <20261029200024.32206-1-raaztilak07@gmail.com> (raw)
Use test_path_exists and test_path_is_missing instead of "test -e"
and "! test -f" in the post-merge hook tests, so that a failure
reports which path was unexpectedly missing or present instead of
failing silently.
Signed-off-by: Tilak Kumar <raaztilak07@gmail.com>
---
t/t5402-post-merge-hook.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh
index c77aa56421..1e222ac28f 100755
--- a/t/t5402-post-merge-hook.sh
+++ b/t/t5402-post-merge-hook.sh
@@ -37,12 +37,12 @@ test_expect_success 'setup clone hooks' '
test_expect_success 'post-merge does not run for up-to-date ' '
GIT_DIR=clone1/.git git merge $commit0 &&
- ! test -f clone1/.git/post-merge.args
+ test_path_is_missing clone1/.git/post-merge.args
'
test_expect_success 'post-merge runs as expected ' '
GIT_DIR=clone1/.git git merge $commit1 &&
- test -e clone1/.git/post-merge.args
+ test_path_exists clone1/.git/post-merge.args
'
test_expect_success 'post-merge from normal merge receives the right argument ' '
@@ -51,7 +51,7 @@ test_expect_success 'post-merge from normal merge receives the right argument '
test_expect_success 'post-merge from squash merge runs as expected ' '
GIT_DIR=clone2/.git git merge --squash $commit1 &&
- test -e clone2/.git/post-merge.args
+ test_path_exists clone2/.git/post-merge.args
'
test_expect_success 'post-merge from squash merge receives the right argument ' '
--
2.55.0
next reply other threads:[~2026-10-29 20:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 20:00 Tilak Kumar [this message]
2026-10-29 20:17 ` [GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f Mark C. Chu-Carroll
2026-10-29 20:32 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029200024.32206-1-raaztilak07@gmail.com \
--to=raaztilak07@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.