Subject: Re: [PATCH 06/12] t: prepare execution of potentially failing commands for `set -e`

From: Junio C Hamano <[email-masked]>
Date: Tue, 14 Apr 2026 06:41:39 -0700

Patrick Steinhardt <[email-masked]> writes:

> I'm a bit confused. We do exactly that in "test-lib.sh" now, see the
> below hunk that is part of this patch. Am I missing something?

No, I was misreading the patch and "$GIT_BINARY" >/dev/null in *preimage*
was pulling my attention away from the fixed one with "version".

Thanks for correcting me.

>
> Patrick
>
>> > diff --git a/t/test-lib.sh b/t/test-lib.sh
>> > index 70fd3e9baf..81380fe978 100644
>> > --- a/t/test-lib.sh
>> > +++ b/t/test-lib.sh
>> > @@ -143,8 +143,8 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>> >  ################################################################
>> >  # It appears that people try to run tests without building...
>> >  GIT_BINARY="${GIT_TEST_INSTALLED:-$GIT_BUILD_DIR}/git$X"
>> > -"$GIT_BINARY" >/dev/null
>> > -if test $? != 1
>> > +
>> > +if ! "$GIT_BINARY" version >/dev/null
>> >  then
>> >  	if test -n "$GIT_TEST_INSTALLED"
>> >  	then