diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-03 13:35:30 -0800 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2018-12-03 17:02:10 -0800 |
commit | ef8f8ec604035142916271178b009f57faf1877a (patch) | |
tree | b5836ab7f84946055777ca5c9c1aa0c207215410 /src/buf_text.c | |
parent | 59b054cb7efbfa97153f3d4dc0ab22c9ded31a22 (diff) | |
download | libgit2-ef8f8ec604035142916271178b009f57faf1877a.tar.gz |
crlf: update to match git's logic
Examine the recent CRLF changes to git by Torsten Bögershausen and
include similar changes to update our CRLF logic to match.
Note: Torsten Bögershausen has previously agreed to allow his changes to
be included in libgit2.
Diffstat (limited to 'src/buf_text.c')
-rw-r--r-- | src/buf_text.c | 3 |
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)); } |