Skip to content

Commit e8736d2

Browse files
committed
fixup! Teach t0027 about native end-of-lines
1 parent 88703a4 commit e8736d2

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

t/t0027-auto-crlf.sh

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,11 @@ create_gitattributes () {
5555
esac
5656
}
5757

58-
# Some warnings depend on the native end-of-line marker
59-
60-
test_have_prereq NATIVE_CRLF &&
61-
NATIVE_CRLF=t ||
62-
NATIVE_CRLF=
63-
6458
check_warning () {
65-
case "$1,$NATIVE_CRLF" in
66-
LF_CRLF,*|MAYBE_CRLF,t|MIX,t) grep "LF will be replaced by CRLF" $2;;
67-
CRLF_LF,*|MAYBE_LF,|MIX,) grep "CRLF will be replaced by LF" $2;;
68-
,*|MAYBE_CRLF,|MAYBE_LF,t)
59+
case "$1" in
60+
LF_CRLF) grep "LF will be replaced by CRLF" $2;;
61+
CRLF_LF) grep "CRLF will be replaced by LF" $2;;
62+
'')
6963
>expect
7064
grep "will be replaced by" $2 >actual
7165
test_cmp expect actual
@@ -181,17 +175,16 @@ test_expect_success 'add files empty attr' '
181175
create_file_in_repo input "" "" "CRLF_LF" "CRLF_LF" "" ""
182176
'
183177

184-
185178
test_expect_success 'add files attr=auto' '
186-
create_file_in_repo false "auto" "MAYBE_CRLF" "MAYBE_LF" "MIX" "" "" &&
187-
create_file_in_repo true "auto" "LF_CRLF" "" "LF_CRLF" "" "" &&
188-
create_file_in_repo input "auto" "" "CRLF_LF" "CRLF_LF" "" ""
179+
create_file_in_repo false "auto" "" "CRLF_LF" "CRLF_LF" "" "" &&
180+
create_file_in_repo true "auto" "LF_CRLF" "" "LF_CRLF" "" "" &&
181+
create_file_in_repo input "auto" "" "CRLF_LF" "CRLF_LF" "" ""
189182
'
190183

191184
test_expect_success 'add files attr=text' '
192-
create_file_in_repo false "text" "MAYBE_CRLF" "MAYBE_LF" "MIX" "MAYBE_CRLF" "MAYBE_LF" &&
193-
create_file_in_repo true "text" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" "" &&
194-
create_file_in_repo input "text" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
185+
create_file_in_repo false "text" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF" &&
186+
create_file_in_repo true "text" "LF_CRLF" "" "LF_CRLF" "LF_CRLF" "" &&
187+
create_file_in_repo input "text" "" "CRLF_LF" "CRLF_LF" "" "CRLF_LF"
195188
'
196189

197190
test_expect_success 'add files attr=-text' '

0 commit comments

Comments
 (0)