From: Dorine Tipo <dorine.a.tipo@gmail.com>
To: git@vger.kernel.org
Cc: kaartic.sivaraam@gmail.com, christian.couder@gmail.com,
siddharthasthana31@gmail.com, usmanakinyemi202@gmail.com,
Dorine Tipo <dorine.a.tipo@gmail.com>
Subject: [Outreachy PATCH 2/2] t0410: keep git's exit code in test_grep calls
Date: Wed, 14 Oct 2026 16:45:04 +0300 [thread overview]
Message-ID: <20261014134504.1152225-3-dorine.a.tipo@gmail.com> (raw)
In-Reply-To: <20261014134504.1152225-1-dorine.a.tipo@gmail.com>
The 'rev-list stops traversal at missing and promised tree' test passes
"$(git -C repo rev-parse ...)" directly to test_grep. t/README says
not to use command substitution in a way that discards git's exit
code: the && chain only sees test_grep's exit code, so a failure in
git is not caught there.
Assign the rev-parse output to variables first and pass those to
test_grep instead.
Signed-off-by: Dorine Tipo <dorine.a.tipo@gmail.com>
---
t/t0410-partial-clone.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index a24b663f73..57da830105 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -413,9 +413,13 @@ test_expect_success 'rev-list stops traversal at missing and promised tree' '
git -C repo config core.repositoryformatversion 1 &&
git -C repo config extensions.partialclone "arbitrary string" &&
git -C repo rev-list --exclude-promisor-objects --objects HEAD >out &&
- test_grep $(git -C repo rev-parse foo) out &&
+
+ FOO=$(git -C repo rev-parse foo) &&
+ HEAD_OID=$(git -C repo rev-parse HEAD) &&
+
+ test_grep "$FOO" out &&
test_grep ! $TREE out &&
- test_grep $(git -C repo rev-parse HEAD) out &&
+ test_grep "$HEAD_OID" out &&
test_grep ! $TREE2 out
'
--
2.34.1
prev parent reply other threads:[~2026-10-14 13:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 13:45 [Outreachy PATCH 0/2] t0410: fix exit code and hash assumptions in the missing-tree test Dorine Tipo
2026-10-14 13:45 ` [Outreachy PATCH 1/2] t0410: use rev-parse to get the subtree OID Dorine Tipo
2026-10-14 20:01 ` Junio C Hamano
2026-10-14 13:45 ` Dorine Tipo [this message]
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=20261014134504.1152225-3-dorine.a.tipo@gmail.com \
--to=dorine.a.tipo@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=kaartic.sivaraam@gmail.com \
--cc=siddharthasthana31@gmail.com \
--cc=usmanakinyemi202@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox