Commit 66b2626c93532df3006232442b471b77f182a92b

Edward Thomson 2014-02-09T13:43:56

core.autocrlf=input w/ text=auto attr to workdir

diff --git a/src/crlf.c b/src/crlf.c
index e1bd557..db69cab 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));