]> git.ipfire.org Git - thirdparty/git.git/blob - t/t0024-crlf-archive.sh
The third batch
[thirdparty/git.git] / t / t0024-crlf-archive.sh
1 #!/bin/sh
2
3 test_description='respect crlf in git archive'
4
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_expect_success setup '
9
10 git config core.autocrlf true &&
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
20 test_expect_success 'tar archive' '
21
22 git archive --format=tar HEAD >test.tar &&
23 mkdir untarred &&
24 "$TAR" xf test.tar -C untarred &&
25
26 test_cmp sample untarred/sample
27
28 '
29
30 test_expect_success UNZIP 'zip archive' '
31
32 git archive --format=zip HEAD >test.zip &&
33
34 mkdir unzipped &&
35 (
36 cd unzipped &&
37 "$GIT_UNZIP" ../test.zip
38 ) &&
39
40 test_cmp sample unzipped/sample
41
42 '
43
44 test_done