{"thread":{"id":"66709","subject":"[GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f","startedAt":"2026-10-29T20:00:24Z","lastAt":"2026-10-29T20:32:16Z","messageCount":3,"participants":["Tilak Kumar","Mark C. Chu-Carroll","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"556822","messageId":"20261029200024.32206-1-raaztilak07@gmail.com","threadId":"66709","inReplyTo":null,"subject":"[GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f","fromName":"Tilak Kumar","fromEmail":"raaztilak07@gmail.com","sentAt":"2026-10-29T20:00:24Z","receivedAt":"2026-10-29T20:00:24Z","isPatch":true,"sender":{"key":"raaztilak07@gmail.com","avatar":null},"body":"Use test_path_exists and test_path_is_missing instead of \"test -e\"\nand \"! test -f\" in the post-merge hook tests, so that a failure\nreports which path was unexpectedly missing or present instead of\nfailing silently.\n\nSigned-off-by: Tilak Kumar <raaztilak07@gmail.com>\n---\n t/t5402-post-merge-hook.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh\nindex c77aa56421..1e222ac28f 100755\n--- a/t/t5402-post-merge-hook.sh\n+++ b/t/t5402-post-merge-hook.sh\n@@ -37,12 +37,12 @@ test_expect_success 'setup clone hooks' '\n \n test_expect_success 'post-merge does not run for up-to-date ' '\n \tGIT_DIR=clone1/.git git merge $commit0 &&\n-\t! test -f clone1/.git/post-merge.args\n+\ttest_path_is_missing clone1/.git/post-merge.args\n '\n \n test_expect_success 'post-merge runs as expected ' '\n \tGIT_DIR=clone1/.git git merge $commit1 &&\n-\ttest -e clone1/.git/post-merge.args\n+\ttest_path_exists clone1/.git/post-merge.args\n '\n \n test_expect_success 'post-merge from normal merge receives the right argument ' '\n@@ -51,7 +51,7 @@ test_expect_success 'post-merge from normal merge receives the right argument '\n \n test_expect_success 'post-merge from squash merge runs as expected ' '\n \tGIT_DIR=clone2/.git git merge --squash $commit1 &&\n-\ttest -e clone2/.git/post-merge.args\n+\ttest_path_exists clone2/.git/post-merge.args\n '\n \n test_expect_success 'post-merge from squash merge receives the right argument ' '\n-- \n2.55.0\n\n\n"},{"id":"556824","messageId":"DMHLKVCPT29F.1JXB7BAOXBPYT@fastmail.com","threadId":"66709","inReplyTo":"20261029200024.32206-1-raaztilak07@gmail.com","subject":"Re: [GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f","fromName":"Mark C. Chu-Carroll","fromEmail":"markchucarroll@fastmail.com","sentAt":"2026-10-29T20:17:13Z","receivedAt":"2026-10-29T20:17:13Z","isPatch":true,"sender":{"key":"markchucarroll@fastmail.com","avatar":null},"body":"On Thu Oct 29, 2026 at 4:00 PM EDT, Tilak Kumar wrote:\n> Use test_path_exists and test_path_is_missing instead of \"test -e\"\n> and \"! test -f\" in the post-merge hook tests, so that a failure\n> reports which path was unexpectedly missing or present instead of\n> failing silently.\n>\n> Signed-off-by: Tilak Kumar <raaztilak07@gmail.com>\n> ---\n>  t/t5402-post-merge-hook.sh | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t5402-post-merge-hook.sh b/t/t5402-post-merge-hook.sh\n> index c77aa56421..1e222ac28f 100755\n> --- a/t/t5402-post-merge-hook.sh\n> +++ b/t/t5402-post-merge-hook.sh\n> @@ -37,12 +37,12 @@ test_expect_success 'setup clone hooks' '\n>  \n>  test_expect_success 'post-merge does not run for up-to-date ' '\n>  \tGIT_DIR=clone1/.git git merge $commit0 &&\n> -\t! test -f clone1/.git/post-merge.args\n> +\ttest_path_is_missing clone1/.git/post-merge.args\n>  '\n>  \n>  test_expect_success 'post-merge runs as expected ' '\n>  \tGIT_DIR=clone1/.git git merge $commit1 &&\n> -\ttest -e clone1/.git/post-merge.args\n> +\ttest_path_exists clone1/.git/post-merge.args\n>  '\n>  \n>  test_expect_success 'post-merge from normal merge receives the right argument ' '\n> @@ -51,7 +51,7 @@ test_expect_success 'post-merge from normal merge receives the right argument '\n>  \n>  test_expect_success 'post-merge from squash merge runs as expected ' '\n>  \tGIT_DIR=clone2/.git git merge --squash $commit1 &&\n> -\ttest -e clone2/.git/post-merge.args\n> +\ttest_path_exists clone2/.git/post-merge.args\n>  '\n>  \n>  test_expect_success 'post-merge from squash merge receives the right argument ' '\n\nlooks correct to me.\n\n\n\n-- \nMark Craig Chu-Carroll (@MarkChuCarroll at gitlab)\n*** Software Tools/Math Geek - Software Engineer at Gitlab\n*** Work Email: mcarroll@gitlab.com / markchucarroll@fastmail.com\n*** Personal Blog: http://goodmath.org/blog / Personal email: markcc@gmail.com\n\n\n"},{"id":"556827","messageId":"xmqqcxss1c4v.fsf@gitster.g","threadId":"66709","inReplyTo":"DMHLKVCPT29F.1JXB7BAOXBPYT@fastmail.com","subject":"Re: [GSoC PATCH] t5402: use test_path_* helpers instead of test -e and test -f","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-10-29T20:32:16Z","receivedAt":"2026-10-29T20:32:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Mark C. Chu-Carroll\" <markchucarroll@fastmail.com> writes:\n\n> On Thu Oct 29, 2026 at 4:00 PM EDT, Tilak Kumar wrote:\n>> Use test_path_exists and test_path_is_missing instead of \"test -e\"\n>> and \"! test -f\" in the post-merge hook tests, so that a failure\n>> reports which path was unexpectedly missing or present instead of\n>> failing silently.\n>>\n>> Signed-off-by: Tilak Kumar <raaztilak07@gmail.com>\n>> ...\n>>  \n>>  test_expect_success 'post-merge from squash merge runs as expected ' '\n>>  \tGIT_DIR=clone2/.git git merge --squash $commit1 &&\n>> -\ttest -e clone2/.git/post-merge.args\n>> +\ttest_path_exists clone2/.git/post-merge.args\n>>  '\n>>  \n>>  test_expect_success 'post-merge from squash merge receives the right argument ' '\n>\n> looks correct to me.\n\nThanks for writing and reviewing.  Queued.\n\n"}]}