Re: [PATCH 8/8] t/test-lib: make feature-testbed job more accessible

From
Patrick Steinhardt <hidden>
Date
2026-10-28 07:41:34
Reply to
Junio C Hamano, 2026-10-27
On Tue, Oct 27, 2026 at 01:59:31PM -0700, Junio C Hamano wrote:
Phillip Wood [off-list ref] writes:
quoted
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_*.
quoted
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
quoted
+	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.
Fair. I've queued this change locally for now, but will wait for the
discussion to figure out whether I'll keep this change in the first
place.

Thanks!

Patrick
Thread (32 messages) 32 messages, 5 authors, last reply 4d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help