Browse Source

test-lib: factor out $GIT_UNZIP setup

We set up the $GIT_UNZIP variable and lazy prereq in
multiple places (and the next patch is about to add another
one). Let's factor it out to avoid repeating ourselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Jeff King 12 years ago committed by Junio C Hamano
parent
commit
f838ce5826
  1. 6
      t/t0024-crlf-archive.sh
  2. 6
      t/t5003-archive-zip.sh
  3. 6
      t/test-lib.sh

6
t/t0024-crlf-archive.sh

@ -3,12 +3,6 @@ @@ -3,12 +3,6 @@
test_description='respect crlf in git archive'

. ./test-lib.sh
GIT_UNZIP=${GIT_UNZIP:-unzip}

test_lazy_prereq UNZIP '
"$GIT_UNZIP" -v
test $? -ne 127
'

test_expect_success setup '


6
t/t5003-archive-zip.sh

@ -3,15 +3,9 @@ @@ -3,15 +3,9 @@
test_description='git archive --format=zip test'

. ./test-lib.sh
GIT_UNZIP=${GIT_UNZIP:-unzip}

SUBSTFORMAT=%H%n

test_lazy_prereq UNZIP '
"$GIT_UNZIP" -v
test $? -ne 127
'

test_lazy_prereq UNZIP_SYMLINKS '
(
mkdir unzip-symlinks &&

6
t/test-lib.sh

@ -750,3 +750,9 @@ test_lazy_prereq AUTOIDENT ' @@ -750,3 +750,9 @@ test_lazy_prereq AUTOIDENT '
# When the tests are run as root, permission tests will report that
# things are writable when they shouldn't be.
test -w / || test_set_prereq SANITY

GIT_UNZIP=${GIT_UNZIP:-unzip}
test_lazy_prereq UNZIP '
"$GIT_UNZIP" -v
test $? -ne 127
'

Loading…
Cancel
Save