From: Junio C Hamano Date: Tue, 27 Oct 2026 20:59:31 GMT Subject: Re: [PATCH 8/8] t/test-lib: make feature-testbed job more accessible Message-ID: In-Reply-To: <1da30fde-75bf-469f-80e1-ce90cd29c84d@gmail.com> Phillip Wood writes: > That all sounds sensible, the commit message could maybe flag that the > "feature-testbed" also sets OPENSSL_SHA1_UNSAFE which > "--feature-testbed" does not because it is only concerned with GIT_TEST_*. > >> diff --git a/t/test-lib.sh b/t/test-lib.sh >> index de566309861..8863bcac930 100644 >> --- a/t/test-lib.sh >> +++ b/t/test-lib.sh >> @@ -202,6 +202,14 @@ finalize_test_case_output () { :; } >> finalize_test_leak_output () { :; } >> finalize_test_output () { :; } >> >> +set_default_env () { >> + if eval "test -z \"\${$1+set}\"" > > This made me scratch my head for a couple of minutes, but I think it is > correct > > set_default_env ABC 1 > > evaluates > > test -z "${ABC+set}" > > to see if $ABC is unset. > > Thanks > > Phillip >> + then >> + eval "$1=\$2" This one may want to quote the right hand side to be more widely portable, i.e., eval "$1=\"\$2\"" or something along that line. POSIX Bourne shell does not require the right hand side VARIABLE=$VAR to be quoted, but CodingGuidelines has observed some buggy shells. It may be better to be extra clear than sorry.