Subject: [GSoC PATCH 06/16] t5304: avoid suppressing git's exit code

From: Trieu Huynh <[email-masked]>
Date: Sun, 29 Mar 2026 05:02:45 +0900

Update t5304-prune.sh to redirect git-cmds output to a
temporary file instead of piping it directly to not hide the
exit code of git commands behind pipes, as a crash in git
might go unnoticed.

Signed-off-by: Trieu Huynh <[email-masked]>
---
 t/t5304-prune.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index 2be7cd30de..a6d235a8a5 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -264,7 +264,8 @@ test_expect_success 'prune .git/shallow when there are no loose objects' '
 	git update-ref refs/heads/shallow-tip $oid &&
 	git repack -ad &&
 	# verify assumption that all loose objects are gone
-	git count-objects | grep ^0 &&
+	git count-objects >actual &&
+	test_grep "^0" actual &&
 	git prune &&
 	echo $oid >expect &&
 	test_cmp expect .git/shallow
-- 
2.43.0