summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-11 16:55:57 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-11 16:55:57 -0800
commit8db2f665e1b25c2e88ddb00b402a4aa3b73a4cf4 (patch)
tree1d29355e3df139e3b137aa577c42ee8ef74b6ef7
parentThe second batch for 2.36 (diff)
parentdocs: correct documentation about eol attribute (diff)
downloadtgif-8db2f665e1b25c2e88ddb00b402a4aa3b73a4cf4.tar.xz
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
-rw-r--r--Documentation/gitattributes.txt11
-rwxr-xr-xt/t0027-auto-crlf.sh6
2 files changed, 12 insertions, 5 deletions
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 83fd4e19a4..60984a4682 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -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"::
diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
index 4a5c5c602c..c5f7ac63b0 100755
--- a/t/t0027-auto-crlf.sh
+++ b/t/t0027-auto-crlf.sh
@@ -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.