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:
Junio C Hamano
2010-06-21 06:02:49 -07:00
12 changed files with 570 additions and 110 deletions

View File

@ -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;