Skip to content

Commit 70ad8c8

Browse files
tboegigitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ded2444 commit 70ad8c8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Documentation/config.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ core.quotePath::
337337

338338
core.eol::
339339
Sets the line ending type to use in the working directory for
340-
files that have the `text` property set. Alternatives are
341-
'lf', 'crlf' and 'native', which uses the platform's native
342-
line ending. The default value is `native`. See
340+
files that have the `text` property set when core.autocrlf is false.
341+
Alternatives are 'lf', 'crlf' and 'native', which uses the platform's
342+
native line ending. The default value is `native`. See
343343
linkgit:gitattributes[5] for more information on end-of-line
344344
conversion.
345345

config.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,6 @@ static int git_default_core_config(const char *var, const char *value)
803803

804804
if (!strcmp(var, "core.autocrlf")) {
805805
if (value && !strcasecmp(value, "input")) {
806-
if (core_eol == EOL_CRLF)
807-
return error("core.autocrlf=input conflicts with core.eol=crlf");
808806
auto_crlf = AUTO_CRLF_INPUT;
809807
return 0;
810808
}
@@ -830,8 +828,6 @@ static int git_default_core_config(const char *var, const char *value)
830828
core_eol = EOL_NATIVE;
831829
else
832830
core_eol = EOL_UNSET;
833-
if (core_eol == EOL_CRLF && auto_crlf == AUTO_CRLF_INPUT)
834-
return error("core.autocrlf=input conflicts with core.eol=crlf");
835831
return 0;
836832
}
837833

0 commit comments

Comments
 (0)