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

From
Junio C Hamano <hidden>
Date
2026-10-27 20:59:34
Reply to
Phillip Wood, 2026-10-27
Phillip Wood [off-list ref] 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_*.
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.
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