Subject: Re: [GSoC PATCH 07/16] t4153: avoid suppressing git's exit code

From: Tian Yuchen <[email-masked]>
Date: Sun, 29 Mar 2026 23:59:19 +0800

On 3/29/26 04:02, Trieu Huynh wrote:
> Update t4153-am-resume-override-opts.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/t4153-am-resume-override-opts.sh | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh
> index 9bec989a0e..30137aec20 100755
> --- a/t/t4153-am-resume-override-opts.sh
> +++ b/t/t4153-am-resume-override-opts.sh
> @@ -81,7 +81,8 @@ test_expect_success '--signoff overrides --no-signoff' '
>   
>   	# Applied side1 will be signed off
>   	echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
> -	git cat-file commit HEAD^ | grep "Signed-off-by:" >actual &&
> +	git cat-file commit HEAD^ >commit_raw &&
> +	test_grep "Signed-off-by:" commit_raw >actual &&

The behavior of 'test_grep' is the opposite of what you might expect. It 
does nothing when the input matches, and only reports an error when it 
doesn't match. Therefore, 'actual' is empty here...

>   	test_cmp expected actual &&
>   
>   	# Applied side2 will not be signed off

...and this test is bound to fail.

Regards, Yuchen