1#!/bin/sh
2
3test_description='respect crlf in git archive'
4
5. ./test-lib.sh
6
7test_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
19test_expect_success 'tar archive' '
20
21 git archive --format=tar HEAD |
22 ( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
23
24 test_cmp sample untarred/sample
25
26'
27
28test_expect_success UNZIP 'zip archive' '
29
30 git archive --format=zip HEAD >test.zip &&
31
32 ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&
33
34 test_cmp sample unzipped/sample
35
36'
37
38test_done