From: Santhosh <santhoshprogrammer07@gmail.com>
To: git@vger.kernel.org
Cc: Santhosh <santhoshprogrammer07@gmail.com>
Subject: [PATCH] t/perf/p5304: catch git count-objects failures
Date: Sun, 1 Mar 2026 07:52:53 +0530 [thread overview]
Message-ID: <20260301022253.129736-1-santhoshprogrammer07@gmail.com> (raw)
Piping `git count-objects` into `grep` masks the exit code of the
git command. If `count-objects` fails but `grep` succeeds, the
pipeline reports success, potentially hiding bugs.
Write the output to a temporary file instead to ensure the exit
code of the git command is properly evaluated.
Signed-off-by: Santhosh <santhoshprogrammer07@gmail.com>
---
t/perf/p5304-prune.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/perf/p5304-prune.sh b/t/perf/p5304-prune.sh
index 83baedb8a4..af59424de8 100755
--- a/t/perf/p5304-prune.sh
+++ b/t/perf/p5304-prune.sh
@@ -14,7 +14,7 @@ test_expect_success 'remove unreachable loose objects' '
'
test_expect_success 'confirm there are no loose objects' '
- git count-objects | grep ^0
+ git count-objects >out && grep ^0 out
'
test_perf 'prune with no objects' '
--
2.43.0
reply other threads:[~2026-03-01 2:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260301022253.129736-1-santhoshprogrammer07@gmail.com \
--to=santhoshprogrammer07@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox