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>
Jeff King committed
Mar 10, 2013 at 21:31 UTC
f838ce5826a2deffff7b70986fc7392d7114013e
3 files changed
+6
-12
t/t0024-crlf-archive.sh
-6
@@ -3,12 +3,6 @@
3
test_description='respect crlf in git archive'
4
5
. ./test-lib.sh
6
-GIT_UNZIP=${GIT_UNZIP:-unzip}
7
-
8
-test_lazy_prereq UNZIP '
9
- "$GIT_UNZIP" -v
10
- test $? -ne 127
11
-'
6
7
test_expect_success setup '
8
t/t5003-archive-zip.sh
-6
@@ -3,15 +3,9 @@
3
test_description='git archive --format=zip test'
4
5
. ./test-lib.sh
6
-GIT_UNZIP=${GIT_UNZIP:-unzip}
6
7
SUBSTFORMAT=%H%n
8
10
-test_lazy_prereq UNZIP '
11
- "$GIT_UNZIP" -v
12
- test $? -ne 127
13
-'
14
-
9
test_lazy_prereq UNZIP_SYMLINKS '
10
(
11
mkdir unzip-symlinks &&
t/test-lib.sh
+6
@@ -750,3 +750,9 @@ test_lazy_prereq AUTOIDENT '
750
# When the tests are run as root, permission tests will report that
751
# things are writable when they shouldn't be.
752
test -w / || test_set_prereq SANITY
753
+
754
+GIT_UNZIP=${GIT_UNZIP:-unzip}
755
+test_lazy_prereq UNZIP '
756
+ "$GIT_UNZIP" -v
757
+ test $? -ne 127
758
+'