Raw
1 #!/bin/sh
2
3 test_description='respect crlf in git archive'
4
5 . ./test-lib.sh
6
7 test_expect_success setup '
8
9 git config core.autocrlf true &&
10
11 printf "CRLF line ending\r\nAnd another\r\n" >sample &&
12 git add sample &&
13
14 test_tick &&
15 git commit -m Initial
16
17 '
18
19 test_expect_success 'tar archive' '
20
21 git archive --format=tar HEAD >test.tar &&
22 mkdir untarred &&
23 "$TAR" xf test.tar -C untarred &&
24
25 test_cmp sample untarred/sample
26
27 '
28
29 test_expect_success UNZIP 'zip archive' '
30
31 git archive --format=zip HEAD >test.zip &&
32
33 mkdir unzipped &&
34 (
35 cd unzipped &&
36 "$GIT_UNZIP" ../test.zip
37 ) &&
38
39 test_cmp sample unzipped/sample
40
41 '
42
43 test_done