t0024, t5000: clear variable UNZIP, use GIT_UNZIP instead
[alt-git.git] / t / t0024-crlf-archive.sh
blob080fe5c6dde2227021e7aa959f64258a9cce14c1
1 #!/bin/sh
3 test_description='respect crlf in git archive'
5 . ./test-lib.sh
6 GIT_UNZIP=${GIT_UNZIP:-unzip}
8 test_expect_success setup '
10 git config core.autocrlf true &&
12 printf "CRLF line ending\r\nAnd another\r\n" > sample &&
13 git add sample &&
15 test_tick &&
16 git commit -m Initial
20 test_expect_success 'tar archive' '
22 git archive --format=tar HEAD |
23 ( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
25 test_cmp sample untarred/sample
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
33 test_set_prereq UNZIP
36 test_expect_success UNZIP 'zip archive' '
38 git archive --format=zip HEAD >test.zip &&
40 ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&
42 test_cmp sample unzipped/sample
46 test_done