@@ -72,6 +72,10 @@ test_expect_success 'Merge after setting text=auto' '
72
72
same line
73
73
EOF
74
74
75
+ if test_have_prereq NATIVE_CRLF; then
76
+ append_cr <expected >expected.temp &&
77
+ mv expected.temp expected
78
+ fi &&
75
79
git config merge.renormalize true &&
76
80
git rm -fr . &&
77
81
rm -f .gitattributes &&
@@ -86,6 +90,10 @@ test_expect_success 'Merge addition of text=auto' '
86
90
same line
87
91
EOF
88
92
93
+ if test_have_prereq NATIVE_CRLF; then
94
+ append_cr <expected >expected.temp &&
95
+ mv expected.temp expected
96
+ fi &&
89
97
git config merge.renormalize true &&
90
98
git rm -fr . &&
91
99
rm -f .gitattributes &&
@@ -95,16 +103,19 @@ test_expect_success 'Merge addition of text=auto' '
95
103
'
96
104
97
105
test_expect_success ' Detect CRLF/LF conflict after setting text=auto' '
98
- q_to_cr <<-\EOF >expected &&
99
- <<<<<<<
100
- first line
101
- same line
102
- =======
103
- first lineQ
104
- same lineQ
105
- >>>>>>>
106
- EOF
107
-
106
+ echo "<<<<<<<" >expected &&
107
+ if test_have_prereq NATIVE_CRLF; then
108
+ echo first line | append_cr >>expected &&
109
+ echo same line | append_cr >>expected &&
110
+ echo ======= | append_cr >>expected
111
+ else
112
+ echo first line >>expected &&
113
+ echo same line >>expected &&
114
+ echo ======= >>expected
115
+ fi &&
116
+ echo first line | append_cr >>expected &&
117
+ echo same line | append_cr >>expected &&
118
+ echo ">>>>>>>" >>expected &&
108
119
git config merge.renormalize false &&
109
120
rm -f .gitattributes &&
110
121
git reset --hard a &&
@@ -114,16 +125,19 @@ test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '
114
125
'
115
126
116
127
test_expect_success ' Detect LF/CRLF conflict from addition of text=auto' '
117
- q_to_cr <<-\EOF >expected &&
118
- <<<<<<<
119
- first lineQ
120
- same lineQ
121
- =======
122
- first line
123
- same line
124
- >>>>>>>
125
- EOF
126
-
128
+ echo "<<<<<<<" >expected &&
129
+ echo first line | append_cr >>expected &&
130
+ echo same line | append_cr >>expected &&
131
+ if test_have_prereq NATIVE_CRLF; then
132
+ echo ======= | append_cr >>expected &&
133
+ echo first line | append_cr >>expected &&
134
+ echo same line | append_cr >>expected
135
+ else
136
+ echo ======= >>expected &&
137
+ echo first line >>expected &&
138
+ echo same line >>expected
139
+ fi &&
140
+ echo ">>>>>>>" >>expected &&
127
141
git config merge.renormalize false &&
128
142
rm -f .gitattributes &&
129
143
git reset --hard b &&
0 commit comments