jgit/org.eclipse.jgit.test/tst/org/eclipse/jgit
Thomas Wolf 83eddaf7fd 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>
2021-10-31 13:02:04 +01:00
..
api Binary and CR-LF detection: lone CRs -> binary 2021-10-31 13:02:04 +01:00
attributes Ignore core.eol if core.autocrlf=input 2020-05-22 17:09:23 -04:00
diff Make the buffer size for text/binary detection configurable 2021-10-30 23:05:22 +02:00
dircache Allow to resolve a conflict by checking out a file 2020-11-17 14:27:28 +01:00
events Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
fnmatch Remove duplicate copyright statements 2020-01-04 01:34:46 +01:00
gitrepo RepoCommand: Do not set 'branch' if the revision is a tag 2021-05-26 14:32:04 +02:00
ignore Remove duplicate copyright statements 2020-01-04 01:34:46 +01:00
indexdiff IndexDiffWithSymlinkTest: handle InaccessibleObjectException 2021-09-29 17:13:05 +02:00
internal DFS block cache: fix lock issue and support parallel index loading 2021-10-19 15:01:59 -07:00
junit Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
lib Fix checkout of files with mixed line endings on text=auto eol=crlf 2021-10-27 00:22:42 +02:00
logging Fix bug in PerformanceLogContext 2020-11-06 19:20:08 -04:00
merge Make the buffer size for text/binary detection configurable 2021-10-30 23:05:22 +02:00
nls Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
notes Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
patch Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
revplot Revert "RevWalk: stop mixing lines of history in topo sort" 2020-02-26 14:47:20 -05:00
revwalk Fix RevWalk.getMergedInto() ignores annotated tags 2021-10-08 12:05:48 +02:00
storage/file [spotbugs] Fix potential NPE in FileBasedConfigTest 2020-12-17 18:42:00 +01:00
submodule Ensure .gitmodules is loaded when accessing submodule name 2020-10-25 22:24:17 +01:00
symlinks Fix remaining javadoc errors raised by doclint 2017-12-21 02:42:14 +01:00
test/resources Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
transport Merge branch 'stable-5.12' into stable-5.13 2021-10-15 22:58:21 +02:00
treewalk Fix PathSuffixFilter: can decide only on full paths 2021-06-21 13:03:22 +02:00
util Binary and CR-LF detection: lone CRs -> binary 2021-10-31 13:02:04 +01:00