t0027: test cases for combined attributes

Add more test cases for the not normalized files ("NNO"). The "text" attribute is most important, use it as the first parameter. "ident", if set, is the second paramater followed by the eol attribute. The eol attribute overrides core.autocrlf, which overrides core.eol. indent is not yet used, this will be done in the next commit. Use loops to test more combinations of attributes, like "* text eol=crlf" or especially "*text=auto eol=crlf". Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Torsten Bögershausen committed Apr 25, 2016 at 18:56 UTC 67e9bff06a82fd4c3f0caa577c1c8a3a0fc975ac
1 file changed +129 -169
t/t0027-auto-crlf.sh
+129 -169
@@ -52,14 +52,17 @@ create_gitattributes () {
52 create_NNO_files () {
53 for crlf in false true input
54 do
55 - for attr in "" auto text -text lf crlf
55 + for attr in "" auto text -text
56 do
57 - pfx=NNO_${crlf}_attr_${attr} &&
58 - cp CRLF_mix_LF ${pfx}_LF.txt &&
59 - cp CRLF_mix_LF ${pfx}_CRLF.txt &&
60 - cp CRLF_mix_LF ${pfx}_CRLF_mix_LF.txt &&
61 - cp CRLF_mix_LF ${pfx}_LF_mix_CR.txt &&
62 - cp CRLF_mix_LF ${pfx}_CRLF_nul.txt
57 + for aeol in "" lf crlf
58 + do
59 + pfx=NNO_attr_${attr}_aeol_${aeol}_${crlf}
60 + cp CRLF_mix_LF ${pfx}_LF.txt &&
61 + cp CRLF_mix_LF ${pfx}_CRLF.txt &&
62 + cp CRLF_mix_LF ${pfx}_CRLF_mix_LF.txt &&
63 + cp CRLF_mix_LF ${pfx}_LF_mix_CR.txt &&
64 + cp CRLF_mix_LF ${pfx}_CRLF_nul.txt
65 + done
66 done
67 done
68 }
@@ -100,16 +103,17 @@ commit_check_warn () {
103 }
104
105 commit_chk_wrnNNO () {
103 - crlf=$1
104 - attr=$2
105 - lfwarn=$3
106 - crlfwarn=$4
107 - lfmixcrlf=$5
108 - lfmixcr=$6
109 - crlfnul=$7
110 - pfx=NNO_${crlf}_attr_${attr}
106 + attr=$1 ; shift
107 + aeol=$1 ; shift
108 + crlf=$1 ; shift
109 + lfwarn=$1 ; shift
110 + crlfwarn=$1 ; shift
111 + lfmixcrlf=$1 ; shift
112 + lfmixcr=$1 ; shift
113 + crlfnul=$1 ; shift
114 + pfx=NNO_attr_${attr}_aeol_${aeol}_${crlf}
115 #Commit files on top of existing file
112 - create_gitattributes "$attr" &&
116 + create_gitattributes "$attr" $aeol &&
117 for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
118 do
119 fname=${pfx}_$f.txt &&
@@ -122,19 +126,19 @@ commit_chk_wrnNNO () {
126 test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
127 check_warning "$lfwarn" ${pfx}_LF.err
128 '
125 - test_expect_success "commit NNO files crlf=$crlf attr=$attr CRLF" '
129 + test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF" '
130 check_warning "$crlfwarn" ${pfx}_CRLF.err
131 '
132
129 - test_expect_success "commit NNO files crlf=$crlf attr=$attr CRLF_mix_LF" '
133 + test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_mix_LF" '
134 check_warning "$lfmixcrlf" ${pfx}_CRLF_mix_LF.err
135 '
136
133 - test_expect_success "commit NNO files crlf=$crlf attr=$attr LF_mix_cr" '
137 + test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf LF_mix_cr" '
138 check_warning "$lfmixcr" ${pfx}_LF_mix_CR.err
139 '
140
137 - test_expect_success "commit NNO files crlf=$crlf attr=$attr CRLF_nul" '
141 + test_expect_success "commit NNO files attr=$attr aeol=$aeol crlf=$crlf CRLF_nul" '
142 check_warning "$crlfnul" ${pfx}_CRLF_nul.err
143 '
144 }
@@ -163,6 +167,7 @@ stats_ascii () {
167
168 # contruct the attr/ returned by git ls-files --eol
169 # Take none (=empty), one or two args
170 +# convert.c: eol=XX overrides text=auto
171 attr_ascii () {
172 case $1,$2 in
173 -text,*) echo "-text" ;;
@@ -170,8 +175,8 @@ attr_ascii () {
175 text,lf) echo "text eol=lf" ;;
176 text,crlf) echo "text eol=crlf" ;;
177 auto,) echo "text=auto" ;;
173 - auto,lf) echo "text=auto eol=lf" ;;
174 - auto,crlf) echo "text=auto eol=crlf" ;;
178 + auto,lf) echo "text eol=lf" ;;
179 + auto,crlf) echo "text eol=crlf" ;;
180 lf,) echo "text eol=lf" ;;
181 crlf,) echo "text eol=crlf" ;;
182 ,) echo "" ;;
@@ -196,28 +201,29 @@ check_files_in_repo () {
201 }
202
203 check_in_repo_NNO () {
199 - crlf=$1
200 - attr=$2
201 - lfname=$3
202 - crlfname=$4
203 - lfmixcrlf=$5
204 - lfmixcr=$6
205 - crlfnul=$7
206 - pfx=NNO_${crlf}_attr_${attr}_
207 - test_expect_success "compare_files $lfname ${pfx}LF.txt" '
208 - compare_files $lfname ${pfx}LF.txt
204 + attr=$1 ; shift
205 + aeol=$1 ; shift
206 + crlf=$1 ; shift
207 + lfname=$1 ; shift
208 + crlfname=$1 ; shift
209 + lfmixcrlf=$1 ; shift
210 + lfmixcr=$1 ; shift
211 + crlfnul=$1 ; shift
212 + pfx=NNO_attr_${attr}_aeol_${aeol}_${crlf}
213 + test_expect_success "compare_files $lfname ${pfx}_LF.txt" '
214 + compare_files $lfname ${pfx}_LF.txt
215 '
210 - test_expect_success "compare_files $crlfname ${pfx}CRLF.txt" '
211 - compare_files $crlfname ${pfx}CRLF.txt
216 + test_expect_success "compare_files $crlfname ${pfx}_CRLF.txt" '
217 + compare_files $crlfname ${pfx}_CRLF.txt
218 '
213 - test_expect_success "compare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt" '
214 - compare_files $lfmixcrlf ${pfx}CRLF_mix_LF.txt
219 + test_expect_success "compare_files $lfmixcrlf ${pfx}_CRLF_mix_LF.txt" '
220 + compare_files $lfmixcrlf ${pfx}_CRLF_mix_LF.txt
221 '
216 - test_expect_success "compare_files $lfmixcr ${pfx}LF_mix_CR.txt" '
217 - compare_files $lfmixcr ${pfx}LF_mix_CR.txt
222 + test_expect_success "compare_files $lfmixcr ${pfx}_LF_mix_CR.txt" '
223 + compare_files $lfmixcr ${pfx}_LF_mix_CR.txt
224 '
219 - test_expect_success "compare_files $crlfnul ${pfx}CRLF_nul.txt" '
220 - compare_files $crlfnul ${pfx}CRLF_nul.txt
225 + test_expect_success "compare_files $crlfnul ${pfx}_CRLF_nul.txt" '
226 + compare_files $crlfnul ${pfx}_CRLF_nul.txt
227 '
228 }
229
@@ -232,7 +238,7 @@ checkout_files () {
238 lfmixcrlf=$1 ; shift
239 lfmixcr=$1 ; shift
240 crlfnul=$1 ; shift
235 - create_gitattributes "$attr" "$ident" &&
241 + create_gitattributes "$attr" $ident $aeol &&
242 git config core.autocrlf $crlf &&
243 pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ &&
244 for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul
@@ -245,7 +251,7 @@ checkout_files () {
251 fi
252 done
253
248 - test_expect_success "ls-files --eol attr=$attr $ident $aeol core.autocrlf=$crlf core.eol=$ceol" '
254 + test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '
255 test_when_finished "rm expect actual" &&
256 sort <<-EOF >expect &&
257 i/crlf w/$(stats_ascii $crlfname) attr/$(attr_ascii $attr $aeol) crlf_false_attr__CRLF.txt
@@ -260,19 +266,19 @@ checkout_files () {
266 sort >actual &&
267 test_cmp expect actual
268 '
263 - test_expect_success "checkout $ident $attr $aeol core.autocrlf=$crlf core.eol=$ceol file=LF" "
269 + test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=LF" "
270 compare_ws_file $pfx $lfname crlf_false_attr__LF.txt
271 "
266 - test_expect_success "checkout $ident $attr $aeol core.autocrlf=$crlf core.eol=$ceol file=CRLF" "
272 + test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=CRLF" "
273 compare_ws_file $pfx $crlfname crlf_false_attr__CRLF.txt
274 "
269 - test_expect_success "checkout $ident $attr $aeol core.autocrlf=$crlf core.eol=$ceol file=CRLF_mix_LF" "
275 + test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=CRLF_mix_LF" "
276 compare_ws_file $pfx $lfmixcrlf crlf_false_attr__CRLF_mix_LF.txt
277 "
272 - test_expect_success "checkout $ident $attr $aeol core.autocrlf=$crlf core.eol=$ceol file=LF_mix_CR" "
278 + test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=LF_mix_CR" "
279 compare_ws_file $pfx $lfmixcr crlf_false_attr__LF_mix_CR.txt
280 "
275 - test_expect_success "checkout $ident $attr $aeol core.autocrlf=$crlf core.eol=$ceol file=LF_nul" "
281 + test_expect_success "checkout attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol file=LF_nul" "
282 compare_ws_file $pfx $crlfnul crlf_false_attr__LF_nul.txt
283 "
284 }
@@ -386,31 +392,31 @@ test_expect_success 'commit files attr=crlf' '
392 commit_check_warn input "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""
393 '
394
389 -# attr LF CRLF CRLFmixLF LF_mix_CR CRLFNUL
390 -commit_chk_wrnNNO false "" "" "" "" "" ""
391 -commit_chk_wrnNNO true "" "LF_CRLF" "" "" "" ""
392 -commit_chk_wrnNNO input "" "" "" "" "" ""
393 -
395 +# attr LF CRLF CRLFmixLF LF_mix_CR CRLFNUL
396 +commit_chk_wrnNNO "" "" false "" "" "" "" ""
397 +commit_chk_wrnNNO "" "" true LF_CRLF "" "" "" ""
398 +commit_chk_wrnNNO "" "" input "" "" "" "" ""
399
395 -commit_chk_wrnNNO false "auto" "$WILC" "$WICL" "$WAMIX" "" ""
396 -commit_chk_wrnNNO true "auto" "LF_CRLF" "" "LF_CRLF" "" ""
397 -commit_chk_wrnNNO input "auto" "" "CRLF_LF" "CRLF_LF" "" ""
400 +commit_chk_wrnNNO "auto" "" false "$WILC" "$WICL" "$WAMIX" "" ""
401 +commit_chk_wrnNNO "auto" "" true LF_CRLF "" LF_CRLF "" ""
402 +commit_chk_wrnNNO "auto" "" input "" CRLF_LF CRLF_LF "" ""
403
399 -commit_chk_wrnNNO false "text" "$WILC" "$WICL" "$WAMIX" "$WILC" "$WICL"
400 -commit_chk_wrnNNO true "text" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""
401 -commit_chk_wrnNNO input "text" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
402 -
403 -commit_chk_wrnNNO false "-text" "" "" "" "" ""
404 -commit_chk_wrnNNO true "-text" "" "" "" "" ""
405 -commit_chk_wrnNNO input "-text" "" "" "" "" ""
406 -
407 -commit_chk_wrnNNO false "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
408 -commit_chk_wrnNNO true "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
409 -commit_chk_wrnNNO input "lf" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
404 +for crlf in true false input
405 +do
406 + commit_chk_wrnNNO -text "" $crlf "" "" "" "" ""
407 + commit_chk_wrnNNO -text lf $crlf "" "" "" "" ""
408 + commit_chk_wrnNNO -text crlf $crlf "" "" "" "" ""
409 + commit_chk_wrnNNO "" lf $crlf "" CRLF_LF CRLF_LF "" CRLF_LF
410 + commit_chk_wrnNNO "" crlf $crlf LF_CRLF "" LF_CRLF LF_CRLF ""
411 + commit_chk_wrnNNO auto lf $crlf "" CRLF_LF CRLF_LF "" CRLF_LF
412 + commit_chk_wrnNNO auto crlf $crlf LF_CRLF "" LF_CRLF LF_CRLF ""
413 + commit_chk_wrnNNO text lf $crlf "" CRLF_LF CRLF_LF "" CRLF_LF
414 + commit_chk_wrnNNO text crlf $crlf LF_CRLF "" LF_CRLF LF_CRLF ""
415 +done
416
411 -commit_chk_wrnNNO false "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""
412 -commit_chk_wrnNNO true "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""
413 -commit_chk_wrnNNO input "crlf" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" ""
417 +commit_chk_wrnNNO "text" "" false "$WILC" "$WICL" "$WAMIX" "$WILC" "$WICL"
418 +commit_chk_wrnNNO "text" "" true LF_CRLF "" LF_CRLF LF_CRLF ""
419 +commit_chk_wrnNNO "text" "" input "" CRLF_LF CRLF_LF "" CRLF_LF
420
421 test_expect_success 'create files cleanup' '
422 rm -f *.txt &&
@@ -441,24 +447,20 @@ test_expect_success 'commit -text' '
447 check_files_in_repo input "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
448 '
449
444 -# attr LF CRLF CRLF_mix_LF LF_mix_CR CRLFNUL
445 -check_in_repo_NNO false "" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
446 -check_in_repo_NNO true "" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
447 -check_in_repo_NNO input "" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
448 -
449 -check_in_repo_NNO false "auto" LF LF LF LF_mix_CR CRLF_nul
450 -check_in_repo_NNO true "auto" LF LF LF LF_mix_CR CRLF_nul
451 -check_in_repo_NNO input "auto" LF LF LF LF_mix_CR CRLF_nul
452 -
453 -check_in_repo_NNO false "text" LF LF LF LF_mix_CR LF_nul
454 -check_in_repo_NNO true "text" LF LF LF LF_mix_CR LF_nul
455 -check_in_repo_NNO input "text" LF LF LF LF_mix_CR LF_nul
456 -
457 -check_in_repo_NNO false "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
458 -check_in_repo_NNO true "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
459 -check_in_repo_NNO input "-text" LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
460 -
461 -
450 +for crlf in true false input
451 +do
452 + # attr aeol LF CRLF CRLF_mix_LF LF_mix_CR CRLFNUL
453 + check_in_repo_NNO "" "" $crlf LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
454 + check_in_repo_NNO -text "" $crlf LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
455 + check_in_repo_NNO -text lf $crlf LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
456 + check_in_repo_NNO -text crlf $crlf LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
457 + check_in_repo_NNO auto "" $crlf LF LF LF LF_mix_CR CRLF_nul
458 + check_in_repo_NNO auto lf $crlf LF LF LF LF_mix_CR LF_nul
459 + check_in_repo_NNO auto crlf $crlf LF LF LF LF_mix_CR LF_nul
460 + check_in_repo_NNO text "" $crlf LF LF LF LF_mix_CR LF_nul
461 + check_in_repo_NNO text lf $crlf LF LF LF LF_mix_CR LF_nul
462 + check_in_repo_NNO text crlf $crlf LF LF LF LF_mix_CR LF_nul
463 +done
464 ################################################################################
465 # Check how files in the repo are changed when they are checked out
466 # How to read the table below:
@@ -490,89 +492,47 @@ LFNUL=LF_nul
492 fi
493 export CRLF_MIX_LF_CR MIX NL
494
493 -checkout_files "" "" "" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
494 -checkout_files "" "" "" false crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
495 -checkout_files "" "" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
496 -checkout_files "" "" "" false native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
497 -checkout_files "" "" "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
498 -checkout_files "" "" "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
499 -checkout_files "" "" "" true "" CRLF CRLF CRLF_mix_LF LF_mix_CR LF_nul
500 -checkout_files "" "" "" true crlf CRLF CRLF CRLF_mix_LF LF_mix_CR LF_nul
501 -checkout_files "" "" "" true lf CRLF CRLF CRLF_mix_LF LF_mix_CR LF_nul
502 -checkout_files "" "" "" true native CRLF CRLF CRLF_mix_LF LF_mix_CR LF_nul
503 -checkout_files "" ident "" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
504 -checkout_files "" ident "" false crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
505 -checkout_files "" ident "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
506 -checkout_files "" ident "" false native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
507 -checkout_files "" ident "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
508 -checkout_files "" ident "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
509 -checkout_files "" ident "" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
510 -checkout_files "" ident "" true crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
511 -checkout_files "" ident "" true lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
512 -checkout_files "" ident "" true native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
513 -checkout_files "auto" "" "" false "" $NL CRLF $MIX_CRLF_LF LF_mix_CR LF_nul
514 -checkout_files "auto" "" "" false crlf CRLF CRLF CRLF LF_mix_CR LF_nul
515 -checkout_files "auto" "" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
516 -checkout_files "auto" "" "" false native $NL CRLF $MIX_CRLF_LF LF_mix_CR LF_nul
517 -checkout_files "auto" "" "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
518 -checkout_files "auto" "" "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
519 -checkout_files "auto" "" "" true "" CRLF CRLF CRLF LF_mix_CR LF_nul
520 -checkout_files "auto" "" "" true crlf CRLF CRLF CRLF LF_mix_CR LF_nul
521 -checkout_files "auto" "" "" true lf CRLF CRLF CRLF LF_mix_CR LF_nul
522 -checkout_files "auto" "" "" true native CRLF CRLF CRLF LF_mix_CR LF_nul
523 -checkout_files "auto" ident "" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
524 -checkout_files "auto" ident "" false crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
525 -checkout_files "auto" ident "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
526 -checkout_files "auto" ident "" false native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
527 -checkout_files "auto" ident "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
528 -checkout_files "auto" ident "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
529 -checkout_files "auto" ident "" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
530 -checkout_files "auto" ident "" true crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
531 -checkout_files "auto" ident "" true lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
532 -checkout_files "auto" ident "" true native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
533 -
534 -for id in "" ident;
495 +# Same handling with and without ident
496 +for id in ""
497 do
536 - checkout_files "crlf" "$id" "" false "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
537 - checkout_files "crlf" "$id" "" false crlf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
538 - checkout_files "crlf" "$id" "" false lf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
539 - checkout_files "crlf" "$id" "" false native CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
540 - checkout_files "crlf" "$id" "" input "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
541 - checkout_files "crlf" "$id" "" input lf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
542 - checkout_files "crlf" "$id" "" true "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
543 - checkout_files "crlf" "$id" "" true crlf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
544 - checkout_files "crlf" "$id" "" true lf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
545 - checkout_files "crlf" "$id" "" true native CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
546 - checkout_files "lf" "$id" "" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
547 - checkout_files "lf" "$id" "" false crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
548 - checkout_files "lf" "$id" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
549 - checkout_files "lf" "$id" "" false native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
550 - checkout_files "lf" "$id" "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
551 - checkout_files "lf" "$id" "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
552 - checkout_files "lf" "$id" "" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
553 - checkout_files "lf" "$id" "" true crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
554 - checkout_files "lf" "$id" "" true lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
555 - checkout_files "lf" "$id" "" true native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
556 - checkout_files "text" "$id" "" false "" $NL CRLF $MIX_CRLF_LF $MIX_LF_CR $LFNUL
557 - checkout_files "text" "$id" "" false crlf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
558 - checkout_files "text" "$id" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
559 - checkout_files "text" "$id" "" false native $NL CRLF $MIX_CRLF_LF $MIX_LF_CR $LFNUL
560 - checkout_files "text" "$id" "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
561 - checkout_files "text" "$id" "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
562 - checkout_files "text" "$id" "" true "" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
563 - checkout_files "text" "$id" "" true crlf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
564 - checkout_files "text" "$id" "" true lf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
565 - checkout_files "text" "$id" "" true native CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
566 - checkout_files "-text" "$id" "" false "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
567 - checkout_files "-text" "$id" "" false crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
568 - checkout_files "-text" "$id" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
569 - checkout_files "-text" "$id" "" false native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
570 - checkout_files "-text" "$id" "" input "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
571 - checkout_files "-text" "$id" "" input lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
572 - checkout_files "-text" "$id" "" true "" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
573 - checkout_files "-text" "$id" "" true crlf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
574 - checkout_files "-text" "$id" "" true lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
575 - checkout_files "-text" "$id" "" true native LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
498 + for ceol in lf crlf native
499 + do
500 + for crlf in true false input
501 + do
502 + # -text overrides core.autocrlf and core.eol
503 + # text and eol=crlf or eol=lf override core.autocrlf and core.eol
504 + checkout_files -text "$id" "" "$crlf" "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
505 + checkout_files -text "$id" "lf" "$crlf" "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
506 + checkout_files -text "$id" "crlf" "$crlf" "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
507 + # text
508 + checkout_files text "$id" "lf" "$crlf" "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
509 + checkout_files text "$id" "crlf" "$crlf" "$ceol" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
510 + # currently the same as text, eol=XXX
511 + checkout_files auto "$id" "lf" "$crlf" "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
512 + checkout_files auto "$id" "crlf" "$crlf" "$ceol" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
513 + done
514 +
515 + # core.autocrlf false, different core.eol
516 + checkout_files "" "$id" "" false "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
517 + # core.autocrlf true
518 + checkout_files "" "$id" "" true "$ceol" CRLF CRLF CRLF_mix_LF LF_mix_CR LF_nul
519 + # text: core.autocrlf = true overrides core.eol
520 + checkout_files auto "$id" "" true "$ceol" CRLF CRLF CRLF LF_mix_CR LF_nul
521 + checkout_files text "$id" "" true "$ceol" CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
522 + # text: core.autocrlf = input overrides core.eol
523 + checkout_files text "$id" "" input "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
524 + checkout_files auto "$id" "" input "$ceol" LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
525 + # text=auto + eol=XXX
526 + done
527 + # text: core.autocrlf=false uses core.eol
528 + checkout_files text "$id" "" false crlf CRLF CRLF CRLF CRLF_mix_CR CRLF_nul
529 + checkout_files text "$id" "" false lf LF CRLF CRLF_mix_LF LF_mix_CR LF_nul
530 + # text: core.autocrlf=false and core.eol unset(or native) uses native eol
531 + checkout_files text "$id" "" false "" $NL CRLF $MIX_CRLF_LF $MIX_LF_CR $LFNUL
532 + checkout_files text "$id" "" false native $NL CRLF $MIX_CRLF_LF $MIX_LF_CR $LFNUL
533 + # auto: core.autocrlf=false and core.eol unset(or native) uses native eol
534 + checkout_files auto "$id" "" false "" $NL CRLF $MIX_CRLF_LF LF_mix_CR LF_nul
535 + checkout_files auto "$id" "" false native $NL CRLF $MIX_CRLF_LF LF_mix_CR LF_nul
536 done
537
538 # Should be the last test case: remove some files from the worktree