Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:47:30

Sorry to reply to self, just want to correct something I missed.

Jonathan Nieder wrote:
Brandon Casey wrote:
quoted
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f2ca536..64e793a 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
[...]
quoted
@@ -183,16 +183,16 @@ test_success=0
 
 die () {
 	code=$?
-	if test -n "$GIT_EXIT_OK"
+	if test -n "$GIT_EXIT_CODE"
 	then
-		exit $code
+		exit $GIT_EXIT_CODE
 	else
 		echo >&5 "FATAL: Unexpected exit with code $code"
 		exit 1
 	fi
 }
$code can be removed now, right?
Sloppy reading on my part here: $code is still used in the error
message on unexpected exits.  The $code will be inaccurate on Suns
in some cases, but this is only a cosmetic problem and the wrong
value should be better than nothing for debugging.
lib-httpd.sh:96:        trap 'code=$?; stop_httpd; (exit $code); die' EXIT

It is probably worth changing that, too, unless GIT_TEST_HTTPD would not
work on these platforms for some other reason.
This is used to support that error message, so it should not be
changed, either.

Your patch looks good.  Maybe the commit message could explain this,
though?

Apologies for the noise,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help