summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-04-24 05:07:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-24 05:07:45 (GMT)
commit848d9a9bb7407cd3a2d45941f732b2ddc32588a7 (patch)
treeb8f6863c33bfd3a6b9a3286d798949c8730141b9 /t
parent6b51cb61812c11915dbcc1d6daeee60ac77297de (diff)
parent85999743e74e35b9100cbeb94112a8ac39ab5a0e (diff)
downloadgit-848d9a9bb7407cd3a2d45941f732b2ddc32588a7.zip
git-848d9a9bb7407cd3a2d45941f732b2ddc32588a7.tar.gz
git-848d9a9bb7407cd3a2d45941f732b2ddc32588a7.tar.bz2
Merge branch 'tb/doc-eol-normalization'
Doc update. * tb/doc-eol-normalization: gitattributes.txt: document how to normalize the line endings
Diffstat (limited to 't')
-rwxr-xr-xt/t0025-crlf-auto.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh
index d0bee08..89826c5 100755
--- a/t/t0025-crlf-auto.sh
+++ b/t/t0025-crlf-auto.sh
@@ -152,4 +152,30 @@ test_expect_success 'eol=crlf _does_ normalize binary files' '
test -z "$LFwithNULdiff"
'
+test_expect_success 'prepare unnormalized' '
+ > .gitattributes &&
+ git config core.autocrlf false &&
+ printf "LINEONE\nLINETWO\r\n" >mixed &&
+ git add mixed .gitattributes &&
+ git commit -m "Add mixed" &&
+ git ls-files --eol | egrep "i/crlf" &&
+ git ls-files --eol | egrep "i/mixed"
+'
+
+test_expect_success 'normalize unnormalized' '
+ echo "* text=auto" >.gitattributes &&
+ rm .git/index &&
+ git add . &&
+ git commit -m "Introduce end-of-line normalization" &&
+ git ls-files --eol | tr "\\t" " " | sort >act &&
+cat >exp <<EOF &&
+i/-text w/-text attr/text=auto LFwithNUL
+i/lf w/crlf attr/text=auto CRLFonly
+i/lf w/crlf attr/text=auto LFonly
+i/lf w/lf attr/text=auto .gitattributes
+i/lf w/mixed attr/text=auto mixed
+EOF
+ test_cmp exp act
+'
+
test_done