Merge branch 'bc/clarify-eol-attr'

Doc and test update around the eol attribute.

* bc/clarify-eol-attr:
  docs: correct documentation about eol attribute
  t0027: add tests for eol without text in .gitattributes
This commit is contained in:
Junio C Hamano 2022-02-11 16:55:57 -08:00
commit 8db2f665e1
2 changed files with 12 additions and 5 deletions

View File

@ -160,11 +160,12 @@ unspecified.
^^^^^
This attribute sets a specific line-ending style to be used in the
working directory. It enables end-of-line conversion without any
content checks, effectively setting the `text` attribute. Note that
setting this attribute on paths which are in the index with CRLF line
endings may make the paths to be considered dirty. Adding the path to
the index again will normalize the line endings in the index.
working directory. This attribute has effect only if the `text`
attribute is set or unspecified, or if it is set to `auto` and the file
is detected as text. Note that setting this attribute on paths which
are in the index with CRLF line endings may make the paths to be
considered dirty. Adding the path to the index again will normalize the
line endings in the index.
Set to string value "crlf"::

View File

@ -597,6 +597,12 @@ do
# auto: core.autocrlf=false and core.eol unset(or native) uses native eol
checkout_files auto "$id" "" false "" $NL CRLF CRLF_mix_LF LF_mix_CR LF_nul
checkout_files auto "$id" "" false native $NL CRLF CRLF_mix_LF LF_mix_CR LF_nul
# core.autocrlf false, .gitattributes sets eol
checkout_files "" "$id" "lf" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
checkout_files "" "$id" "crlf" false "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
# core.autocrlf true, .gitattributes sets eol
checkout_files "" "$id" "lf" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
checkout_files "" "$id" "crlf" true "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
done
# The rest of the tests are unique; do the usual linting.