Re: [PATCH 06/12] t: prepare execution of potentially failing commands for `set -e`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 14, 2026, 13:41 UTC
- Message-ID
- <xmqqeckhek18.fsf@gitster.g>
- In-Reply-To
- <ad3riiF5QWuMmUeT@pks.im>
Patrick Steinhardt <ps@pks.im> 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.
Show 18 quoted lines
>
> 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