diff options
author | Torsten Bögershausen <tboegi@web.de> | 2017-04-12 13:48:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-04-13 15:53:41 -0700 |
commit | 85999743e74e35b9100cbeb94112a8ac39ab5a0e (patch) | |
tree | f8ed9786fa9701fff7ae50f2fc3d1076ed795f1d /t | |
parent | 49800c940790cc7465d1b03e08d472ffd8684808 (diff) | |
download | git-85999743e74e35b9100cbeb94112a8ac39ab5a0e.tar.gz |
gitattributes.txt: document how to normalize the line endingstb/doc-eol-normalization
The instructions how to normalize the line endings should have been updated
as part of commit 6523728499e 'convert: unify the "auto" handling of CRLF',
(but that part never made it into the commit).
Update the documentation in Documentation/gitattributes.txt and add
a test case in t0025.
Reported by Kristian Adrup
https://github.com/git-for-windows/git/issues/954
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t0025-crlf-auto.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh index d0bee08b2e..89826c568b 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 |