convert: allow core.autocrlf=input and core.eol=crlf
Even though the configuration parser errors out when core.autocrlf is set to 'input' when core.eol is set to 'crlf', there is no need to do so, because the core.autocrlf setting trumps core.eol. Allow all combinations of core.crlf and core.eol and document that core.autocrlf overrides core.eol. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
ded2444ad8
commit
70ad8c8d8c
4
config.c
4
config.c
@ -803,8 +803,6 @@ static int git_default_core_config(const char *var, const char *value)
|
||||
|
||||
if (!strcmp(var, "core.autocrlf")) {
|
||||
if (value && !strcasecmp(value, "input")) {
|
||||
if (core_eol == EOL_CRLF)
|
||||
return error("core.autocrlf=input conflicts with core.eol=crlf");
|
||||
auto_crlf = AUTO_CRLF_INPUT;
|
||||
return 0;
|
||||
}
|
||||
@ -830,8 +828,6 @@ static int git_default_core_config(const char *var, const char *value)
|
||||
core_eol = EOL_NATIVE;
|
||||
else
|
||||
core_eol = EOL_UNSET;
|
||||
if (core_eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
|
||||
return error("core.autocrlf=input conflicts with core.eol=crlf");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user