public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] t/perf/p5304: catch git count-objects failures
@ 2026-03-01  2:22 Santhosh
  0 siblings, 0 replies; only message in thread
From: Santhosh @ 2026-03-01  2:22 UTC (permalink / raw)
  To: git; +Cc: Santhosh

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-01  2:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-01  2:22 [PATCH] t/perf/p5304: catch git count-objects failures Santhosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox