summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2016-04-01 18:08:26 +0200
committerJunio C Hamano <gitster@pobox.com>2016-04-01 15:12:39 -0700
commit6cefbece6fe3b483334f8ebf3f00daadc02597c5 (patch)
treecf874b01126e999f1fd489f429dcbf44b947f5b0
parent86b1dc035bd150e70ecd9a159bb116b6f9347856 (diff)
downloadgit-6cefbece6fe3b483334f8ebf3f00daadc02597c5.tar.gz
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>
-rw-r--r--Documentation/config.txt6
-rw-r--r--config.c4
2 files changed, 3 insertions, 7 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 2cd6bdd7d2..4a27ad41cb 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -337,9 +337,9 @@ core.quotePath::
core.eol::
Sets the line ending type to use in the working directory for
- files that have the `text` property set. Alternatives are
- 'lf', 'crlf' and 'native', which uses the platform's native
- line ending. The default value is `native`. See
+ files that have the `text` property set when core.autocrlf is false.
+ Alternatives are 'lf', 'crlf' and 'native', which uses the platform's
+ native line ending. The default value is `native`. See
linkgit:gitattributes[5] for more information on end-of-line
conversion.
diff --git a/config.c b/config.c
index 9ba40bc1b0..a6adc8bc9e 100644
--- a/config.c
+++ b/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;
}