diff mbox series

[1/2] Revert "t/test_lib: avoid naked bash arrays in file_lineno"

Message ID 20200515172117.155238-2-gitster@pobox.com (mailing list archive)
State New, archived
Headers show
Series Unbreak TAP output under bash | expand

Commit Message

Junio C Hamano May 15, 2020, 5:21 p.m. UTC
This reverts commit 303775a25f0b4ac5d6ad2e96eb4404c24209cad8;
instead of trying to salvage the tap-breaking change, let's
revert the whole thing for now for the upcoming release.

The enhancement can be re-attempted in the next cycle.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/test-lib.sh | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/t/test-lib.sh b/t/test-lib.sh
index baf94546da..1b221951a8 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -677,16 +677,14 @@  die () {
 
 file_lineno () {
 	test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0
-	eval '
-		local i
-		for i in ${!BASH_SOURCE[*]}
-		do
-			case $i,"${BASH_SOURCE[$i]##*/}" in
-			0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;;
-			*,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;;
-			esac
-		done
-	'
+	local i
+	for i in ${!BASH_SOURCE[*]}
+	do
+		case $i,"${BASH_SOURCE[$i]##*/}" in
+		0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;;
+		*,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;;
+		esac
+	done
 }
 
 GIT_EXIT_OK=