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