Merge branch 'jc/parseopt-verify-short-name'
[gitweb.git] / t / t6038-merge-text-auto.sh
index d9c2d386ddf8caff4b87fa457c23757f76c293c7..85c10b0940a896bb49aefee9a2885b1c39217bab 100755 (executable)
@@ -72,6 +72,10 @@ test_expect_success 'Merge after setting text=auto' '
        same line
        EOF
 
+       if test_have_prereq NATIVE_CRLF; then
+               append_cr <expected >expected.temp &&
+               mv expected.temp expected
+       fi &&
        git config merge.renormalize true &&
        git rm -fr . &&
        rm -f .gitattributes &&
@@ -86,6 +90,10 @@ test_expect_success 'Merge addition of text=auto' '
        same line
        EOF
 
+       if test_have_prereq NATIVE_CRLF; then
+               append_cr <expected >expected.temp &&
+               mv expected.temp expected
+       fi &&
        git config merge.renormalize true &&
        git rm -fr . &&
        rm -f .gitattributes &&
@@ -95,16 +103,19 @@ test_expect_success 'Merge addition of text=auto' '
 '
 
 test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '
-       q_to_cr <<-\EOF >expected &&
-       <<<<<<<
-       first line
-       same line
-       =======
-       first lineQ
-       same lineQ
-       >>>>>>>
-       EOF
-
+       echo "<<<<<<<" >expected &&
+       if test_have_prereq NATIVE_CRLF; then
+               echo first line | append_cr >>expected &&
+               echo same line | append_cr >>expected &&
+               echo ======= | append_cr >>expected
+       else
+               echo first line >>expected &&
+               echo same line >>expected &&
+               echo ======= >>expected
+       fi &&
+       echo first line | append_cr >>expected &&
+       echo same line | append_cr >>expected &&
+       echo ">>>>>>>" >>expected &&
        git config merge.renormalize false &&
        rm -f .gitattributes &&
        git reset --hard a &&
@@ -114,16 +125,19 @@ test_expect_success 'Detect CRLF/LF conflict after setting text=auto' '
 '
 
 test_expect_success 'Detect LF/CRLF conflict from addition of text=auto' '
-       q_to_cr <<-\EOF >expected &&
-       <<<<<<<
-       first lineQ
-       same lineQ
-       =======
-       first line
-       same line
-       >>>>>>>
-       EOF
-
+       echo "<<<<<<<" >expected &&
+       echo first line | append_cr >>expected &&
+       echo same line | append_cr >>expected &&
+       if test_have_prereq NATIVE_CRLF; then
+               echo ======= | append_cr >>expected &&
+               echo first line | append_cr >>expected &&
+               echo same line | append_cr >>expected
+       else
+               echo ======= >>expected &&
+               echo first line >>expected &&
+               echo same line >>expected
+       fi &&
+       echo ">>>>>>>" >>expected &&
        git config merge.renormalize false &&
        rm -f .gitattributes &&
        git reset --hard b &&