Skip to contentSkip to conversation

t/perf/p5304: catch git count-objects failures

PATCH New Santhosh 1 participant 1 message Mar 1

lore
Share & tools
lore

Santhosh

author
#0 lore raw

PATCH 1/1 t/perf/p5304: catch git count-objects failures

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.

---
 t/perf/p5304-prune.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/perf/p5304-prune.sh +1 -1
index 83baedb8a4..af59424de8 100755
@@ -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' '
Signature · 1 line
2.43.0