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>
Michele Ballabio committed
Nov 10, 2007 at 15:17 UTC
570f32266943d3a96d7ed64844986d847209364d
1 file changed
+10
-5
t/test-lib.sh
+10
-5
@@ -66,9 +66,6 @@ esac
66
tput sgr0 >/dev/null 2>&1 &&
67
color=t
68
69
-test "${test_description}" != "" ||
70
-error "Test script did not set test_description."
71
-
69
while test "$#" -ne 0
70
do
71
case "$1" in
@@ -77,8 +74,7 @@ do
74
-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
75
immediate=t; shift ;;
76
-h|--h|--he|--hel|--help)
80
- echo "$test_description"
81
- exit 0 ;;
77
+ help=t; shift ;;
78
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
79
verbose=t; shift ;;
80
-q|--q|--qu|--qui|--quie|--quiet)
@@ -124,6 +120,15 @@ say () {
120
say_color info "$*"
121
}
122
123
+test "${test_description}" != "" ||
124
+error "Test script did not set test_description."
125
+
126
+if test "$help" = "t"
127
+then
128
+ echo "$test_description"
129
+ exit 0
130
+fi
131
+
132
exec 5>&1
133
if test "$verbose" = "t"
134
then