# [PATCH] t/perf/p5304: catch git count-objects failures

1 messages from 2026-03-01 to 2026-03-01. Participants: Santhosh.
Thread: https://gitlist.dev/t/65104

## Santhosh, 2026-03-01 02:22

Subject: [PATCH] t/perf/p5304: catch git count-objects failures
Message-ID: <20260301022253.129736-1-santhoshprogrammer07@gmail.com>
URL: https://gitlist.dev/e/20260301022253.129736-1-santhoshprogrammer07%40gmail.com

```
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


```
