test-lib.sh: move error line after error() declaration
This patch removes a spurious "command not found" error and actually makes the "Test script did not set test_description." string follow the command line option "--no-color". Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c899a57c28
commit
570f322669
@ -66,9 +66,6 @@ esac
|
|||||||
tput sgr0 >/dev/null 2>&1 &&
|
tput sgr0 >/dev/null 2>&1 &&
|
||||||
color=t
|
color=t
|
||||||
|
|
||||||
test "${test_description}" != "" ||
|
|
||||||
error "Test script did not set test_description."
|
|
||||||
|
|
||||||
while test "$#" -ne 0
|
while test "$#" -ne 0
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -77,8 +74,7 @@ do
|
|||||||
-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
|
-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
|
||||||
immediate=t; shift ;;
|
immediate=t; shift ;;
|
||||||
-h|--h|--he|--hel|--help)
|
-h|--h|--he|--hel|--help)
|
||||||
echo "$test_description"
|
help=t; shift ;;
|
||||||
exit 0 ;;
|
|
||||||
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
|
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
|
||||||
verbose=t; shift ;;
|
verbose=t; shift ;;
|
||||||
-q|--q|--qu|--qui|--quie|--quiet)
|
-q|--q|--qu|--qui|--quie|--quiet)
|
||||||
@ -124,6 +120,15 @@ say () {
|
|||||||
say_color info "$*"
|
say_color info "$*"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test "${test_description}" != "" ||
|
||||||
|
error "Test script did not set test_description."
|
||||||
|
|
||||||
|
if test "$help" = "t"
|
||||||
|
then
|
||||||
|
echo "$test_description"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
exec 5>&1
|
exec 5>&1
|
||||||
if test "$verbose" = "t"
|
if test "$verbose" = "t"
|
||||||
then
|
then
|
||||||
|
Reference in New Issue
Block a user