[GSoC PATCH 08/16] t4150: avoid suppressing git's exit code
- From
Trieu Huynh <vikingtc4@gmail.com>
- Date
- Mar 28, 2026, 20:02 UTC
- Message-ID
- <20260328200255.247759-9-vikingtc4@gmail.com>
- In-Reply-To
- <20260328200255.247759-1-vikingtc4@gmail.com>
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 <vikingtc4@gmail.com> --- 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 "^author.*long@example.com" && - git cat-file commit HEAD | grep "^$LONG$" + git cat-file commit HEAD >actual && + test_grep "^author.*long@example.com" actual && + test_grep "^$LONG$" actual ' test_expect_success 'am --quit keeps HEAD where it is' '
-- 2.43.0