summaryrefslogtreecommitdiff
path: root/src/buf_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buf_text.c')
-rw-r--r--src/buf_text.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buf_text.c b/src/buf_text.c
index 306980b5c..fa7f16b81 100644
--- a/src/buf_text.c
+++ b/src/buf_text.c
@@ -310,6 +310,7 @@ bool git_buf_text_gather_stats(
}
}
- return (stats->nul > 0 ||
+ /* Treat files with a bare CR as binary */
+ return (stats->cr != stats->crlf || stats->nul > 0 ||
((stats->printable >> 7) < stats->nonprintable));
}