Skip to content

Commit

Permalink
Merge branch 'bc/clarify-eol-attr'
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gitster committed Feb 12, 2022
2 parents 2b9c120 + 8c591db commit 8db2f66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Documentation/gitattributes.txt
Expand Up @@ -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"::

Expand Down
6 changes: 6 additions & 0 deletions t/t0027-auto-crlf.sh
Expand Up @@ -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.
Expand Down

0 comments on commit 8db2f66

Please sign in to comment.