Commit 1fe56243 by Vicent Marti

Merge pull request #2435 from ethomson/text_attr

Update text=auto / core.autocrlf=false behavior
parents a252b9e2 d412165f
...@@ -9,3 +9,6 @@ v0.21 + 1 ...@@ -9,3 +9,6 @@ v0.21 + 1
* Use a map for the treebuilder, making insertion O(1) * Use a map for the treebuilder, making insertion O(1)
* LF -> CRLF filter refuses to handle mixed-EOL files * LF -> CRLF filter refuses to handle mixed-EOL files
* LF -> CRLF filter now runs when * text = auto (with Git for Windows 1.9.4)
...@@ -286,7 +286,8 @@ static int crlf_check( ...@@ -286,7 +286,8 @@ static int crlf_check(
if (error < 0) if (error < 0)
return error; return error;
if (ca.auto_crlf == GIT_AUTO_CRLF_FALSE) if (ca.crlf_action == GIT_CRLF_GUESS &&
ca.auto_crlf == GIT_AUTO_CRLF_FALSE)
return GIT_PASSTHROUGH; return GIT_PASSTHROUGH;
if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT && if (ca.auto_crlf == GIT_AUTO_CRLF_INPUT &&
......
...@@ -279,8 +279,13 @@ void test_checkout_crlf__autocrlf_false_text_auto_attr(void) ...@@ -279,8 +279,13 @@ void test_checkout_crlf__autocrlf_false_text_auto_attr(void)
git_checkout_head(g_repo, &opts); git_checkout_head(g_repo, &opts);
if (GIT_EOL_NATIVE == GIT_EOL_CRLF) {
check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF);
check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_AS_CRLF);
} else {
check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW);
check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW);
}
} }
void test_checkout_crlf__autocrlf_true_text_auto_attr(void) void test_checkout_crlf__autocrlf_true_text_auto_attr(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment