]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t6101: avoid suppressing git's exit code
authorTrieu Huynh <vikingtc4@gmail.com>
Sat, 28 Mar 2026 13:59:35 +0000 (22:59 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sat, 28 Mar 2026 18:40:13 +0000 (11:40 -0700)
Update t6101-rev-parse-parents.sh to redirect git-rev-parse
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6101-rev-parse-parents.sh

index 5f55ab98d352fcb24df355e0976586ed848347c1..728188971744c4b585fecf4c35f00f4c119c03d2 100755 (executable)
@@ -39,7 +39,8 @@ test_expect_success 'setup' '
 '
 
 test_expect_success 'start is valid' '
-       git rev-parse start | grep "^$OID_REGEX$"
+       git rev-parse start >actual &&
+       test_grep "^$OID_REGEX$" actual
 '
 
 test_expect_success 'start^0' '