summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-02-09 13:43:56 -0800
committerEdward Thomson <ethomson@microsoft.com>2014-02-09 13:45:40 -0800
commit66b2626c93532df3006232442b471b77f182a92b (patch)
tree7277980cfc661df119a62703e0258e00a5ab3795
parent9780020b18307e3e6a4707fdf0807aa2ddbfcd40 (diff)
downloadlibgit2-66b2626c93532df3006232442b471b77f182a92b.tar.gz
core.autocrlf=input w/ text=auto attr to workdir
-rw-r--r--src/crlf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/crlf.c b/src/crlf.c
index e1bd5572b..db69cab5c 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -269,7 +269,9 @@ static int crlf_check(
if (ca.crlf_action == GIT_CRLF_BINARY)
return GIT_PASSTHROUGH;
- if (ca.crlf_action == GIT_CRLF_GUESS) {
+ if (ca.crlf_action == GIT_CRLF_GUESS ||
+ (ca.crlf_action == GIT_CRLF_AUTO &&
+ git_filter_source_mode(src) == GIT_FILTER_SMUDGE)) {
error = git_repository__cvar(
&ca.auto_crlf, git_filter_source_repo(src), GIT_CVAR_AUTO_CRLF);
if (error < 0)
@@ -277,6 +279,10 @@ static int crlf_check(
if (ca.auto_crlf == GIT_AUTO_CRLF_FALSE)
return GIT_PASSTHROUGH;
+
+ if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT &&
+ git_filter_source_mode(src) == GIT_FILTER_SMUDGE)
+ return GIT_PASSTHROUGH;
}
*payload = git__malloc(sizeof(ca));