https://github.com/git/git
Raw File
Tip revision: 2f0dde7852b7866bb044926f73334ff3fc30654b authored by Junio C Hamano on 13 April 2022, 22:21:31 UTC
Git 2.34.3
Tip revision: 2f0dde7
t0024-crlf-archive.sh
#!/bin/sh

test_description='respect crlf in git archive'

TEST_PASSES_SANITIZE_LEAK=true
. ./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
back to top