3 test_description='CRLF merge conflict across text=auto change
5 * [master] remove .gitattributes
6 ! [side] add line from b
8 + [side] add line from b
9 * [master] remove .gitattributes
10 * [master^] add line from a
11 * [master~2] normalize file
17 test_expect_success setup '
18 git config merge.renormalize true &&
19 git config core.autocrlf false &&
21 echo first line | append_cr >file &&
22 echo first line >control_file &&
23 echo only line >inert_file &&
25 git add file control_file inert_file &&
27 git commit -m "Initial" &&
31 echo "* text=auto" >.gitattributes &&
33 git add .gitattributes file &&
35 git commit -m "normalize file" &&
37 echo same line | append_cr >>file &&
38 echo same line >>control_file &&
39 git add file control_file &&
41 git commit -m "add line from a" &&
44 git rm .gitattributes &&
48 git commit -m "remove .gitattributes" &&
52 echo same line | append_cr >>file &&
53 echo same line >>control_file &&
54 git add file control_file &&
56 git commit -m "add line from b" &&
62 test_expect_success 'Merge after setting text=auto' '
63 cat <<-\EOF >expected &&
69 rm -f .gitattributes &&
72 test_cmp expected file
75 test_expect_success 'Merge addition of text=auto' '
76 cat <<-\EOF >expected &&
82 rm -f .gitattributes &&
85 test_cmp expected file
88 test_expect_success 'Test delete/normalize conflict' '
89 git checkout -f side &&
91 rm -f .gitattributes &&
92 git reset --hard initial &&
94 git commit -m "remove file" &&
95 git checkout master &&
96 git reset --hard a^ &&