Skip to content

Commit

Permalink
Just don't CRLF filter if there are no CRs
Browse files Browse the repository at this point in the history
  • Loading branch information
arrbee committed May 19, 2014
1 parent 16798d0 commit c094197
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/crlf.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,12 @@ static int crlf_apply_to_odb(
if (git_buf_text_gather_stats(&stats, from, false))
return GIT_PASSTHROUGH;

/* If safecrlf is enabled, sanity-check the result. */
if (stats.cr != stats.crlf ||
(stats.crlf > 0 && stats.lf != stats.crlf)) {
/* If there are no CR characters to filter out, then just pass */
if (!stats.cr)
return GIT_PASSTHROUGH;

/* If safecrlf is enabled, sanity-check the result. */
if (stats.cr != stats.crlf || stats.lf != stats.crlf) {
switch (ca->safe_crlf) {
case GIT_SAFE_CRLF_FAIL:
giterr_set(
Expand Down

0 comments on commit c094197

Please sign in to comment.