diff options
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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; |