[GSoC PATCH 06/16] t5304: avoid suppressing git's exit code
- From
Trieu Huynh <vikingtc4@gmail.com>
- Date
- Mar 28, 2026, 20:02 UTC
- Message-ID
- <20260328200255.247759-7-vikingtc4@gmail.com>
- In-Reply-To
- <20260328200255.247759-1-vikingtc4@gmail.com>
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 <vikingtc4@gmail.com> --- 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