diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-10-31 01:35:52 +0200 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-10-31 13:02:04 +0100 |
commit | 83eddaf7fda22ca64e9c3852df67ccef0dacdaf5 (patch) | |
tree | da257cd574e6b83c93bc277a5ea5cad742c0630d /org.eclipse.jgit.benchmarks/.factorypath | |
parent | 3444a3be8c8a567f944fd7b81838e615852d787a (diff) | |
download | jgit-83eddaf7fda22ca64e9c3852df67ccef0dacdaf5.tar.gz jgit-83eddaf7fda22ca64e9c3852df67ccef0dacdaf5.zip |
Binary and CR-LF detection: lone CRs -> binary
C git considers not only files containing NUL bytes as binary but also
files containing lone CRs. Implement this also for JGit.
C git additionally counts printable vs. non-printable characters and
considers files that have non_printable_count > printable_count / 128
also as binary. This is not implemented because such counting probably
only makes sense if one looks at the full file or blob content. The
Auto[CR]LF* streams in JGit look only at the first few KiB of a stream
in order not to buffer too much.
For the C git implementation, see [1].
[1] https://github.com/git/git/blob/7e27bd589d/convert.c#L35
Bug: 576971
Change-Id: Ia169b59bdbf1477f32ee2014eeb8406f81d4b1ab
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.benchmarks/.factorypath')
0 files changed, 0 insertions, 0 deletions