From: Anthony Sottile Date: Mon, 4 Jun 2018 20:17:42 +0000 (-0700) Subject: config.c: fix regression for core.safecrlf false X-Git-Tag: v2.19.0-rc0~178^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6cb09125bea69d9bdb461b8ecacd5c50c9e6a4f5?hp=--cc 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 Acked-By: Torsten Bögershausen Signed-off-by: Junio C Hamano --- 6cb09125bea69d9bdb461b8ecacd5c50c9e6a4f5 diff --git a/config.c b/config.c index 1f003fbb90..a2d91b5ebd 100644 --- a/config.c +++ b/config.c @@ -1156,7 +1156,7 @@ static int git_default_core_config(const char *var, const char *value) } eol_rndtrp_die = git_config_bool(var, value); global_conv_flags_eol = eol_rndtrp_die ? - CONV_EOL_RNDTRP_DIE : CONV_EOL_RNDTRP_WARN; + CONV_EOL_RNDTRP_DIE : 0; return 0; } diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh index 71350e0657..5f056982a5 100755 --- a/t/t0020-crlf.sh +++ b/t/t0020-crlf.sh @@ -98,6 +98,16 @@ test_expect_success 'safecrlf: git diff demotes safecrlf=true to warn' ' ' +test_expect_success 'safecrlf: no warning with safecrlf=false' ' + git config core.autocrlf input && + git config core.safecrlf false && + + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf && + git add allcrlf 2>err && + test_must_be_empty err +' + + test_expect_success 'switch off autocrlf, safecrlf, reset HEAD' ' git config core.autocrlf false && git config core.safecrlf false &&