1#!/bin/sh
   2test_description='respect crlf in git archive'
   4. ./test-lib.sh
   6test_expect_success setup '
   8        git config core.autocrlf true &&
  10        printf "CRLF line ending\r\nAnd another\r\n" > sample &&
  12        git add sample &&
  13        test_tick &&
  15        git commit -m Initial
  16'
  18test_expect_success 'tar archive' '
  20        git archive --format=tar HEAD |
  22        ( mkdir untarred && cd untarred && "$TAR" -xf - ) &&
  23        test_cmp sample untarred/sample
  25'
  27test_expect_success UNZIP 'zip archive' '
  29        git archive --format=zip HEAD >test.zip &&
  31        ( mkdir unzipped && cd unzipped && "$GIT_UNZIP" ../test.zip ) &&
  33        test_cmp sample unzipped/sample
  35'
  37test_done