]> git.ipfire.org Git - thirdparty/git.git/blame - t/t0024-crlf-archive.sh
trace.c: ensure NULL is not passed to printf
[thirdparty/git.git] / t / t0024-crlf-archive.sh
CommitLineData
f1265cc9
CB
1#!/bin/sh
2
3test_description='respect crlf in git archive'
4
5. ./test-lib.sh
6UNZIP=${UNZIP:-unzip}
7
8test_expect_success setup '
9
a48fcd83 10 git config core.autocrlf true &&
f1265cc9
CB
11
12 printf "CRLF line ending\r\nAnd another\r\n" > sample &&
13 git add sample &&
14
15 test_tick &&
16 git commit -m Initial
17
18'
19
20test_expect_success 'tar archive' '
21
22 git archive --format=tar HEAD |
a48fcd83 23 ( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
f1265cc9
CB
24
25 test_cmp sample untarred/sample
26
27'
28
29"$UNZIP" -v >/dev/null 2>&1
30if [ $? -eq 127 ]; then
fae74a04 31 say "Skipping ZIP test, because unzip was not found"
552a26c8
JS
32else
33 test_set_prereq UNZIP
f1265cc9
CB
34fi
35
552a26c8 36test_expect_success UNZIP 'zip archive' '
f1265cc9
CB
37
38 git archive --format=zip HEAD >test.zip &&
39
40 ( mkdir unzipped && cd unzipped && unzip ../test.zip ) &&
41
42 test_cmp sample unzipped/sample
43
44'
45
46test_done