Subject: [GSoC PATCH 01/16] t7004: avoid suppressing git's exit code

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

Update t7004-tag.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/t7004-tag.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh
index ce2ff2a28a..9bd5c98f93 100755
--- a/t/t7004-tag.sh
+++ b/t/t7004-tag.sh
@@ -1560,7 +1560,8 @@ test_expect_success 'filename for the message is relative to cwd' '
 		cd subdir &&
 		git tag -a -F msgfile-5 tag-from-subdir
 	) &&
-	git cat-file tag tag-from-subdir | grep "in sub directory"
+	git cat-file tag tag-from-subdir >actual &&
+	test_grep "in sub directory" actual
 '
 
 test_expect_success 'filename for the message is relative to cwd' '
@@ -1569,7 +1570,8 @@ test_expect_success 'filename for the message is relative to cwd' '
 		cd subdir &&
 		git tag -a -F msgfile-6 tag-from-subdir-2
 	) &&
-	git cat-file tag tag-from-subdir-2 | grep "in sub directory"
+	git cat-file tag tag-from-subdir-2 >actual &&
+	test_grep "in sub directory" actual
 '
 
 # create a few more commits to test --contains
-- 
2.43.0