config.c: fix regression for core.safecrlf false

A regression introduced in 8462ff43 ("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 <asottile@umich.edu> Acked-By: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Anthony Sottile committed Jun 4, 2018 at 13:17 UTC 6cb09125bea69d9bdb461b8ecacd5c50c9e6a4f5
2 files changed +11 -1
config.c
+1 -1
@@ -1156,7 +1156,7 @@ static int git_default_core_config(const char *var, const char *value)
1156 }
1157 eol_rndtrp_die = git_config_bool(var, value);
1158 global_conv_flags_eol = eol_rndtrp_die ?
1159 - CONV_EOL_RNDTRP_DIE : CONV_EOL_RNDTRP_WARN;
1159 + CONV_EOL_RNDTRP_DIE : 0;
1160 return 0;
1161 }
1162
t/t0020-crlf.sh
+10
@@ -98,6 +98,16 @@ test_expect_success 'safecrlf: git diff demotes safecrlf=true to warn' '
98 '
99
100
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 +
111 test_expect_success 'switch off autocrlf, safecrlf, reset HEAD' '
112 git config core.autocrlf false &&
113 git config core.safecrlf false &&