t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead

InfoZIP's unzip takes default parameters from the environment variable UNZIP. Unset it in the test library and use GIT_UNZIP for specifying alternate versions of the unzip command instead. t0024 wasn't even using variable for the actual extraction. t5000 was, but when setting it to InfoZIP's unzip it would try to extract from itself (because it treats the contents of $UNZIP as parameters), which failed of course. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

René Scharfe committed Jan 6, 2013 at 18:47 UTC ac00128298583bcdd42bffc767393868821b6af6
3 files changed +10 -8
t/t0024-crlf-archive.sh
+3 -3
@@ -3,7 +3,7 @@
3 test_description='respect crlf in git archive'
4
5 . ./test-lib.sh
6 -UNZIP=${UNZIP:-unzip}
6 +GIT_UNZIP=${GIT_UNZIP:-unzip}
7
8 test_expect_success setup '
9
@@ -26,7 +26,7 @@ test_expect_success 'tar archive' '
26
27 '
28
29 -"$UNZIP" -v >/dev/null 2>&1
29 +"$GIT_UNZIP" -v >/dev/null 2>&1
30 if [ $? -eq 127 ]; then
31 say "Skipping ZIP test, because unzip was not found"
32 else
@@ -37,7 +37,7 @@ test_expect_success UNZIP 'zip archive' '
37
38 git archive --format=zip HEAD >test.zip &&
39
40 - ( mkdir unzipped && cd unzipped && unzip ../test.zip ) &&
40 + ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&
41
42 test_cmp sample unzipped/sample
43
t/t5000-tar-tree.sh
+5 -5
@@ -25,7 +25,7 @@ commit id embedding:
25 '
26
27 . ./test-lib.sh
28 -UNZIP=${UNZIP:-unzip}
28 +GIT_UNZIP=${GIT_UNZIP:-unzip}
29 GZIP=${GZIP:-gzip}
30 GUNZIP=${GUNZIP:-gzip -d}
31
@@ -37,9 +37,9 @@ check_zip() {
37 dir=$1
38 dir_with_prefix=$dir/$2
39
40 - test_expect_success UNZIP " extract ZIP archive" "
41 - (mkdir $dir && cd $dir && $UNZIP ../$zipfile)
42 - "
40 + test_expect_success UNZIP " extract ZIP archive" '
41 + (mkdir $dir && cd $dir && "$GIT_UNZIP" ../$zipfile)
42 + '
43
44 test_expect_success UNZIP " validate filenames" "
45 (cd ${dir_with_prefix}a && find .) | sort >$listfile &&
@@ -201,7 +201,7 @@ test_expect_success \
201 test_cmp a/substfile2 g/prefix/a/substfile2
202 '
203
204 -$UNZIP -v >/dev/null 2>&1
204 +"$GIT_UNZIP" -v >/dev/null 2>&1
205 if [ $? -eq 127 ]; then
206 say "Skipping ZIP tests, because unzip was not found"
207 else
t/test-lib.sh
+2
@@ -85,6 +85,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
85 .*_TEST
86 PROVE
87 VALGRIND
88 + UNZIP
89 PERF_AGGREGATING_LATER
90 ));
91 my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
@@ -128,6 +129,7 @@ fi
129 unset CDPATH
130
131 unset GREP_OPTIONS
132 +unset UNZIP
133
134 case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
135 1|2|true)