Skip to content

Commit 570f322

Browse files
chungagitster
authored andcommitted
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>
1 parent c899a57 commit 570f322

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

t/test-lib.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ esac
6666
tput sgr0 >/dev/null 2>&1 &&
6767
color=t
6868

69-
test "${test_description}" != "" ||
70-
error "Test script did not set test_description."
71-
7269
while test "$#" -ne 0
7370
do
7471
case "$1" in
@@ -77,8 +74,7 @@ do
7774
-i|--i|--im|--imm|--imme|--immed|--immedi|--immedia|--immediat|--immediate)
7875
immediate=t; shift ;;
7976
-h|--h|--he|--hel|--help)
80-
echo "$test_description"
81-
exit 0 ;;
77+
help=t; shift ;;
8278
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
8379
verbose=t; shift ;;
8480
-q|--q|--qu|--qui|--quie|--quiet)
@@ -124,6 +120,15 @@ say () {
124120
say_color info "$*"
125121
}
126122

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+
127132
exec 5>&1
128133
if test "$verbose" = "t"
129134
then

0 commit comments

Comments
 (0)