diff options
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | convert.c | 2 | ||||
-rw-r--r-- | environment.c | 2 |
3 files changed, 6 insertions, 2 deletions
@@ -325,6 +325,10 @@ int git_default_config(const char *var, const char *value) } if (!strcmp(var, "core.autocrlf")) { + if (value && !strcasecmp(value, "input")) { + auto_crlf = -1; + return 0; + } auto_crlf = git_config_bool(var, value); return 0; } @@ -140,7 +140,7 @@ int convert_to_working_tree(const char *path, char **bufp, unsigned long *sizep) * based on filename patterns. Right now we just do the * stupid auto-CRLF one. */ - if (!auto_crlf) + if (auto_crlf <= 0) return 0; size = *sizep; diff --git a/environment.c b/environment.c index 2fa0960412..570e32ac3c 100644 --- a/environment.c +++ b/environment.c @@ -28,7 +28,7 @@ size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE; size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT; int pager_in_use; int pager_use_color = 1; -int auto_crlf = 0; +int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */ static const char *git_dir; static char *git_object_dir, *git_index_file, *git_refs_dir, *git_graft_file; |