Merge branch 'as/safecrlf-quiet-fix'
authorJunio C Hamano <gitster@pobox.com>
Thu, 28 Jun 2018 19:53:29 +0000 (12:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Jun 2018 19:53:29 +0000 (12:53 -0700)
Fix for 2.17-era regression around `core.safecrlf`.

* as/safecrlf-quiet-fix:
config.c: fix regression for core.safecrlf false

config.c
t/t0020-crlf.sh
index a0a6ae1980d9c95d13bb78422e64850396c1a4d8..f4a208a16607c2f3eb10c02d067808d46399b7a3 100644 (file)
--- a/config.c
+++ b/config.c
@@ -1233,7 +1233,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;
        }
 
index 71350e0657986d7b3e38801d82058c53f9fd23d0..5f056982a53b62810192fc8bbb5dbb6d784fb1a2 100755 (executable)
@@ -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 &&