2008-09-18 20:01:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='respect crlf in git archive'
|
|
|
|
|
2021-10-12 13:56:37 +00:00
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2008-09-18 20:01:13 +00:00
|
|
|
. ./test-lib.sh
|
2013-01-06 17:49:00 +00:00
|
|
|
|
2008-09-18 20:01:13 +00:00
|
|
|
test_expect_success setup '
|
|
|
|
|
2010-10-31 01:46:54 +00:00
|
|
|
git config core.autocrlf true &&
|
2008-09-18 20:01:13 +00:00
|
|
|
|
2024-01-19 03:33:34 +00:00
|
|
|
printf "CRLF line ending\r\nAnd another\r\n" >sample &&
|
2008-09-18 20:01:13 +00:00
|
|
|
git add sample &&
|
|
|
|
|
|
|
|
test_tick &&
|
|
|
|
git commit -m Initial
|
|
|
|
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'tar archive' '
|
|
|
|
|
2024-01-19 03:33:34 +00:00
|
|
|
git archive --format=tar HEAD >test.tar &&
|
2024-01-19 03:33:35 +00:00
|
|
|
mkdir untarred &&
|
|
|
|
"$TAR" xf test.tar -C untarred &&
|
2008-09-18 20:01:13 +00:00
|
|
|
|
|
|
|
test_cmp sample untarred/sample
|
|
|
|
|
|
|
|
'
|
|
|
|
|
2009-03-16 13:44:56 +00:00
|
|
|
test_expect_success UNZIP 'zip archive' '
|
2008-09-18 20:01:13 +00:00
|
|
|
|
|
|
|
git archive --format=zip HEAD >test.zip &&
|
|
|
|
|
2024-01-19 03:33:35 +00:00
|
|
|
mkdir unzipped &&
|
|
|
|
(
|
|
|
|
cd unzipped &&
|
|
|
|
"$GIT_UNZIP" ../test.zip
|
|
|
|
) &&
|
2008-09-18 20:01:13 +00:00
|
|
|
|
|
|
|
test_cmp sample unzipped/sample
|
|
|
|
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|