Merge branch 'cb/test-bash-lineno-fix'
Recent change to show files and line numbers of a breakage during test (only available when running the tests with bash) were hurting other shells with syntax errors, which has been corrected. * cb/test-bash-lineno-fix: t/test_lib: avoid naked bash arrays in file_lineno
This commit is contained in:
@ -677,14 +677,16 @@ die () {
|
|||||||
|
|
||||||
file_lineno () {
|
file_lineno () {
|
||||||
test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0
|
test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0
|
||||||
local i
|
eval '
|
||||||
for i in ${!BASH_SOURCE[*]}
|
local i
|
||||||
do
|
for i in ${!BASH_SOURCE[*]}
|
||||||
case $i,"${BASH_SOURCE[$i]##*/}" in
|
do
|
||||||
0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;;
|
case $i,"${BASH_SOURCE[$i]##*/}" in
|
||||||
*,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;;
|
0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;;
|
||||||
esac
|
*,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;;
|
||||||
done
|
esac
|
||||||
|
done
|
||||||
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
GIT_EXIT_OK=
|
GIT_EXIT_OK=
|
||||||
|
Reference in New Issue
Block a user