Imported Upstream version 2.2.0
[platform/upstream/git.git] / t / t0026-eol-config.sh
index 4807b0f..c5203e2 100755 (executable)
@@ -80,4 +80,24 @@ test_expect_success 'autocrlf=true overrides unset eol' '
        test -z "$onediff" && test -z "$twodiff"
 '
 
+test_expect_success NATIVE_CRLF 'eol native is crlf' '
+
+       rm -rf native_eol && mkdir native_eol &&
+       (
+               cd native_eol &&
+               printf "*.txt text\n" >.gitattributes &&
+               printf "one\r\ntwo\r\nthree\r\n" >filedos.txt &&
+               printf "one\ntwo\nthree\n" >fileunix.txt &&
+               git init &&
+               git config core.autocrlf false &&
+               git config core.eol native &&
+               git add filedos.txt fileunix.txt &&
+               git commit -m "first" &&
+               rm file*.txt &&
+               git reset --hard HEAD &&
+               has_cr filedos.txt &&
+               has_cr fileunix.txt
+       )
+'
+
 test_done