Skip to content

Commit ab96151

Browse files
bk2204gitster
authored andcommitted
t0027: add tests for eol without text in .gitattributes
Right now, it isn't clear what the behavior is when the eol attribute is set in .gitattributes but the text attribute is not. Let's add some tests to document this behavior in our code, which happens to be that the behavior is as if we set the text attribute implicitly. This will make sure we don't accidentally change the behavior, which somebody is probably relying on, and serve as documentation to developers. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9d7761 commit ab96151

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

t/t0027-auto-crlf.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,12 @@ do
597597
# auto: core.autocrlf=false and core.eol unset(or native) uses native eol
598598
checkout_files auto "$id" "" false "" $NL CRLF CRLF_mix_LF LF_mix_CR LF_nul
599599
checkout_files auto "$id" "" false native $NL CRLF CRLF_mix_LF LF_mix_CR LF_nul
600+
# core.autocrlf false, .gitattributes sets eol
601+
checkout_files "" "$id" "lf" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
602+
checkout_files "" "$id" "crlf" false "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
603+
# core.autocrlf true, .gitattributes sets eol
604+
checkout_files "" "$id" "lf" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
605+
checkout_files "" "$id" "crlf" true "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
600606
done
601607

602608
# The rest of the tests are unique; do the usual linting.

0 commit comments

Comments
 (0)