summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-21 13:02:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-06-21 13:02:49 (GMT)
commitd5cff17edaf438bbf45a2130e9cadc0c938291d6 (patch)
tree19acab3f0fbb8fa480cb45a315d0dac2e6f16ab1 /config.c
parentd249515f297d47df6d79167b988eaa7db0981178 (diff)
parent942e7747678ecf5f118ea5b2d0c763166de21f3a (diff)
downloadgit-d5cff17edaf438bbf45a2130e9cadc0c938291d6.zip
git-d5cff17edaf438bbf45a2130e9cadc0c938291d6.tar.gz
git-d5cff17edaf438bbf45a2130e9cadc0c938291d6.tar.bz2
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
Diffstat (limited to 'config.c')
-rw-r--r--config.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/config.c b/config.c
index 9b6b1df..cdcf583 100644
--- a/config.c
+++ b/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;