70
cp CRLF ${pfx}_CRLF.txt &&
71
cp CRLF_mix_LF ${pfx}_CRLF_mix_LF.txt &&
72
cp LF_mix_CR ${pfx}_LF_mix_CR.txt &&
73
- cp CRLF_nul ${pfx}_CRLF_nul.txt
73
+ cp CRLF_nul ${pfx}_CRLF_nul.txt ||
74
+ return 1
75
done
76
done
77
done
102
do
103
fname=${pfx}_$f.txt &&
104
cp $f $fname &&
104
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
105
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
106
+ return 1
107
done &&
108
git commit -m "core.autocrlf $crlf" &&
109
check_warning "$lfname" ${pfx}_LF.err &&
123
lfmixcr=$1 ; shift
124
crlfnul=$1 ; shift
125
pfx=NNO_attr_${attr}_aeol_${aeol}_${crlf}
124
- #Commit files on top of existing file
125
- create_gitattributes "$attr" $aeol &&
126
- for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
127
- do
128
- fname=${pfx}_$f.txt &&
129
- cp $f $fname &&
130
- printf Z >>"$fname" &&
131
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
132
- done
126
+
127
+ test_expect_success 'setup commit NNO files' '
128
+ #Commit files on top of existing file
129
+ create_gitattributes "$attr" $aeol &&
130
+ for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
131
+ do
132
+ fname=${pfx}_$f.txt &&
133
+ cp $f $fname &&
134
+ printf Z >>"$fname" &&
135
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
136
+ return 1
137
+ done
138
+ '
139
140
test_expect_success "commit NNO files crlf=$crlf attr=$attr LF" '
141
check_warning "$lfwarn" ${pfx}_LF.err
169
lfmixcr=$1 ; shift
170
crlfnul=$1 ; shift
171
pfx=MIX_attr_${attr}_aeol_${aeol}_${crlf}
166
- #Commit file with CLRF_mix_LF on top of existing file
167
- create_gitattributes "$attr" $aeol &&
168
- for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
169
- do
170
- fname=${pfx}_$f.txt &&
171
- cp CRLF_mix_LF $fname &&
172
- printf Z >>"$fname" &&
173
- git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err"
174
- done
172
+
173
+ test_expect_success 'setup commit file with mixed EOL' '
174
+ #Commit file with CLRF_mix_LF on top of existing file
175
+ create_gitattributes "$attr" $aeol &&
176
+ for f in LF CRLF CRLF_mix_LF LF_mix_CR CRLF_nul
177
+ do
178
+ fname=${pfx}_$f.txt &&
179
+ cp CRLF_mix_LF $fname &&
180
+ printf Z >>"$fname" &&
181
+ git -c core.autocrlf=$crlf add $fname 2>"${pfx}_$f.err" ||
182
+ return 1
183
+ done
184
+ '
185
186
test_expect_success "commit file with mixed EOL onto LF crlf=$crlf attr=$attr" '
187
check_warning "$lfwarn" ${pfx}_LF.err
299
lfmixcrlf=$1 ; shift
300
lfmixcr=$1 ; shift
301
crlfnul=$1 ; shift
292
- create_gitattributes "$attr" $ident $aeol &&
293
- git config core.autocrlf $crlf &&
302
+ test_expect_success "setup config for checkout attr=$attr ident=$ident aeol=$aeol core.autocrlf=$crlf" '
303
+ create_gitattributes "$attr" $ident $aeol &&
304
+ git config core.autocrlf $crlf
305
+ '
306
pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ &&
307
for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul
308
do
297
- rm crlf_false_attr__$f.txt &&
298
- if test -z "$ceol"; then
299
- git checkout -- crlf_false_attr__$f.txt
300
- else
301
- git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt
302
- fi
309
+ test_expect_success "setup $f checkout ${ceol:+ with -c core.eol=$ceol}" '
310
+ rm -f crlf_false_attr__$f.txt &&
311
+ git ${ceol:+-c core.eol=$ceol} checkout -- crlf_false_attr__$f.txt
312
+ '
313
done
314
315
test_expect_success "ls-files --eol attr=$attr $ident aeol=$aeol core.autocrlf=$crlf core.eol=$ceol" '