Merge branch 'eb/core-eol'
* eb/core-eol: Add "core.eol" config variable Rename the "crlf" attribute "text" Add per-repository eol normalization Add tests for per-repository eol normalization Conflicts: Documentation/config.txt Makefile
This commit is contained in:
18
config.c
18
config.c
@ -517,7 +517,9 @@ static int git_default_core_config(const char *var, const char *value)
|
||||
|
||||
if (!strcmp(var, "core.autocrlf")) {
|
||||
if (value && !strcasecmp(value, "input")) {
|
||||
auto_crlf = -1;
|
||||
if (eol == EOL_CRLF)
|
||||
return error("core.autocrlf=input conflicts with core.eol=crlf");
|
||||
auto_crlf = AUTO_CRLF_INPUT;
|
||||
return 0;
|
||||
}
|
||||
auto_crlf = git_config_bool(var, value);
|
||||
@ -533,6 +535,20 @@ static int git_default_core_config(const char *var, const char *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.eol")) {
|
||||
if (value && !strcasecmp(value, "lf"))
|
||||
eol = EOL_LF;
|
||||
else if (value && !strcasecmp(value, "crlf"))
|
||||
eol = EOL_CRLF;
|
||||
else if (value && !strcasecmp(value, "native"))
|
||||
eol = EOL_NATIVE;
|
||||
else
|
||||
eol = EOL_UNSET;
|
||||
if (eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
|
||||
return error("core.autocrlf=input conflicts with core.eol=crlf");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!strcmp(var, "core.notesref")) {
|
||||
notes_ref_name = xstrdup(value);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user