Skip to content

Commit

Permalink
config.c: fix regression for core.safecrlf false
Browse files Browse the repository at this point in the history
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 <asottile@umich.edu>
Acked-By: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
asottile authored and gitster committed Jun 11, 2018
1 parent 8462ff4 commit 6cb0912
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 10 additions & 0 deletions t/t0020-crlf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 6cb0912

Please sign in to comment.