#!/bin/sh global test_description := ''respect crlf in git archive'' source ./test-lib.sh test_expect_success setup ' git config core.autocrlf true && printf "CRLF line ending\r\nAnd another\r\n" > sample && git add sample && test_tick && git commit -m Initial ' test_expect_success 'tar archive' ' git archive --format=tar HEAD | ( mkdir untarred && cd untarred && "$TAR" -xf - ) && test_cmp sample untarred/sample ' test_expect_success UNZIP 'zip archive' ' git archive --format=zip HEAD >test.zip && ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) && test_cmp sample unzipped/sample ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"respect crlf in git archive">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(setup)} { (SQ <"\n"> <"\n"> <"\tgit config core.autocrlf true &&\n"> <"\n"> <"\tprintf \"CRLF line ending\\r\\nAnd another\\r\\n\" > sample &&\n"> <"\tgit add sample &&\n"> <"\n"> <"\ttest_tick &&\n"> <"\tgit commit -m Initial\n"> <"\n"> ) } ) (C {(test_expect_success)} {(SQ <"tar archive">)} { (SQ <"\n"> <"\n"> <"\tgit archive --format=tar HEAD |\n"> <"\t( mkdir untarred && cd untarred && \"$TAR\" -xf - ) &&\n"> <"\n"> <"\ttest_cmp sample untarred/sample\n"> <"\n"> ) } ) (C {(test_expect_success)} {(UNZIP)} {(SQ <"zip archive">)} { (SQ <"\n"> <"\n"> <"\tgit archive --format=zip HEAD >test.zip &&\n"> <"\n"> <"\t( mkdir unzipped && cd unzipped && \"$GIT_UNZIP\" ../test.zip ) &&\n"> <"\n"> <"\ttest_cmp sample unzipped/sample\n"> <"\n"> ) } ) (C {(test_done)}) ] )