summaryrefslogtreecommitdiff
path: root/src/crlf.c
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-05-22 02:27:33 +0200
committerVicent Marti <vicent@github.com>2014-05-22 02:27:33 +0200
commit7ee233a9203d09a08e269788ca4877778bc0c489 (patch)
tree1289da550fb8d1a08d1d333b0aa2cd014124f7e3 /src/crlf.c
parentff9fb4484b1b9913c9ba3a3e8b639e0d26e585df (diff)
parentc094197bf92736bb1c40cf1ca87bda970ab7f999 (diff)
downloadlibgit2-7ee233a9203d09a08e269788ca4877778bc0c489.tar.gz
Merge pull request #2375 from libgit2/rb/safecrlf-on-lf-platform
Make core.safecrlf not generate an error on LF-ending platforms
Diffstat (limited to 'src/crlf.c')
-rw-r--r--src/crlf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/crlf.c b/src/crlf.c
index dad3ecebc..821e04eb2 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -138,6 +138,10 @@ static int crlf_apply_to_odb(
if (git_buf_text_gather_stats(&stats, from, false))
return GIT_PASSTHROUGH;
+ /* 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) {