Subject: [GSoC PATCH 08/16] t4150: avoid suppressing git's exit code

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

Update t4150-am.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/t4150-am.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 699a81ab5c..462e450c60 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -1094,8 +1094,9 @@ test_expect_success 'am works with multi-line in-body headers' '
 	git checkout HEAD^ &&
 	git am msg &&
 	# Ensure that the author and full message are present
-	git cat-file commit HEAD | grep "[email-masked]" &&
-	git cat-file commit HEAD | grep "^$LONG$"
+	git cat-file commit HEAD >actual &&
+	test_grep "[email-masked]" actual &&
+	test_grep "^$LONG$" actual
 '
 
 test_expect_success 'am --quit keeps HEAD where it is' '
-- 
2.43.0