3 test_description='test conversion filters on large files'
7 test_when_finished 'rm -f .gitattributes' &&
8 echo "* $*" >.gitattributes
12 git read-tree --empty &&
13 git add small large &&
14 git cat-file blob :small >small.index &&
15 git cat-file blob :large | head -n 1 >large.index &&
16 test_cmp small.index large.index
21 git checkout small large &&
22 head -n 1 large >large.head &&
23 test_cmp small large.head
26 test_expect_success 'setup input tests' '
27 printf "\$Id: foo\$\\r\\n" >small &&
28 cat small small >large &&
29 git config core.bigfilethreshold 20 &&
30 git config filter.test.clean "sed s/.*/CLEAN/"
33 test_expect_success 'autocrlf=true converts on input' '
34 test_config core.autocrlf true &&
38 test_expect_success 'eol=crlf converts on input' '
43 test_expect_success 'ident converts on input' '
48 test_expect_success 'user-defined filters convert on input' '
49 set_attr filter=test &&
53 test_expect_success 'setup output tests' '
54 echo "\$Id\$" >small &&
55 cat small small >large &&
56 git add small large &&
57 git config core.bigfilethreshold 7 &&
58 git config filter.test.smudge "sed s/.*/SMUDGE/"
61 test_expect_success 'autocrlf=true converts on output' '
62 test_config core.autocrlf true &&
66 test_expect_success 'eol=crlf converts on output' '
71 test_expect_success 'user-defined filters convert on output' '
72 set_attr filter=test &&
76 test_expect_success 'ident converts on output' '
79 git checkout small large &&
80 sed -n "s/Id: .*/Id: SHA/p" <small >small.clean &&
81 head -n 1 large >large.head &&
82 sed -n "s/Id: .*/Id: SHA/p" <large.head >large.clean &&
83 test_cmp small.clean large.clean