Skip to content

Commit 47e67d4

Browse files
Michael J Grubergitster
authored andcommitted
test-lib: simplify GIT_SKIP_TESTS loop
04ece59 (GIT_SKIP_TESTS: allow users to omit tests that are known to break, 2006-12-28) introduced GIT_SKIP_TESTS, and since then we have had two nested loops iterating over GIT_SKIP_TESTS with the same loop variable. Reduce this to one loop. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 609eb9f commit 47e67d4

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

t/test-lib.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ test_skip () {
385385
case $this_test.$test_count in
386386
$skp)
387387
to_skip=t
388+
break
388389
esac
389390
done
390391
if test -z "$to_skip" && test -n "$prereq" &&
@@ -829,16 +830,8 @@ this_test=${0##*/}
829830
this_test=${this_test%%-*}
830831
for skp in $GIT_SKIP_TESTS
831832
do
832-
to_skip=
833-
for skp in $GIT_SKIP_TESTS
834-
do
835-
case "$this_test" in
836-
$skp)
837-
to_skip=t
838-
esac
839-
done
840-
case "$to_skip" in
841-
t)
833+
case "$this_test" in
834+
$skp)
842835
say_color skip >&3 "skipping test $this_test altogether"
843836
say_color skip "skip all tests in $this_test"
844837
test_done

0 commit comments

Comments
 (0)