Skip to content

Commit 6cb0912

Browse files
asottilegitster
authored andcommitted
config.c: fix regression for core.safecrlf false
A regression introduced in 8462ff4 ("convert_to_git(): safe_crlf/checksafe becomes int conv_flags", 2018-01-13) back in Git 2.17 cycle caused autocrlf rewrites to produce a warning message despite setting safecrlf=false. Signed-off-by: Anthony Sottile <[email protected]> Acked-By: Torsten Bögershausen <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8462ff4 commit 6cb0912

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ static int git_default_core_config(const char *var, const char *value)
11561156
}
11571157
eol_rndtrp_die = git_config_bool(var, value);
11581158
global_conv_flags_eol = eol_rndtrp_die ?
1159-
CONV_EOL_RNDTRP_DIE : CONV_EOL_RNDTRP_WARN;
1159+
CONV_EOL_RNDTRP_DIE : 0;
11601160
return 0;
11611161
}
11621162

t/t0020-crlf.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ test_expect_success 'safecrlf: git diff demotes safecrlf=true to warn' '
9898
'
9999

100100

101+
test_expect_success 'safecrlf: no warning with safecrlf=false' '
102+
git config core.autocrlf input &&
103+
git config core.safecrlf false &&
104+
105+
for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
106+
git add allcrlf 2>err &&
107+
test_must_be_empty err
108+
'
109+
110+
101111
test_expect_success 'switch off autocrlf, safecrlf, reset HEAD' '
102112
git config core.autocrlf false &&
103113
git config core.safecrlf false &&

0 commit comments

Comments
 (0)