Subject: [GSoC PATCH 09/16] t4140: avoid suppressing git's exit code

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

Update t4140-apply-ita.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/t4140-apply-ita.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t4140-apply-ita.sh b/t/t4140-apply-ita.sh
index 0b11a8aef4..15eef0a2ba 100755
--- a/t/t4140-apply-ita.sh
+++ b/t/t4140-apply-ita.sh
@@ -79,7 +79,8 @@ test_expect_success 'apply complex patch with -N' '
 	git apply -N complex-patch &&
 
 	git ls-files --stage --error-unmatch test-file &&
-	git diff | grep "a/committed-file"
+	git diff >actual &&
+	test_grep "a/committed-file" actual
 '
 
 test_done
-- 
2.43.0