Commit c094197b by Russell Belfer

Just don't CRLF filter if there are no CRs

parent 16798d08
...@@ -138,10 +138,12 @@ static int crlf_apply_to_odb( ...@@ -138,10 +138,12 @@ static int crlf_apply_to_odb(
if (git_buf_text_gather_stats(&stats, from, false)) if (git_buf_text_gather_stats(&stats, from, false))
return GIT_PASSTHROUGH; return GIT_PASSTHROUGH;
/* If safecrlf is enabled, sanity-check the result. */ /* If there are no CR characters to filter out, then just pass */
if (stats.cr != stats.crlf || if (!stats.cr)
(stats.crlf > 0 && stats.lf != stats.crlf)) { return GIT_PASSTHROUGH;
/* If safecrlf is enabled, sanity-check the result. */
if (stats.cr != stats.crlf || stats.lf != stats.crlf) {
switch (ca->safe_crlf) { switch (ca->safe_crlf) {
case GIT_SAFE_CRLF_FAIL: case GIT_SAFE_CRLF_FAIL:
giterr_set( giterr_set(
......
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