jgit/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge
Thomas Wolf c2204bb683 Make the buffer size for text/binary detection configurable
The various streams used in JGit for text/binary and CR-LF detection
used different buffer sizes. Most used 8000, but one used 8KiB, and one
used 8096 (SIC!) bytes.

Considering only the first 8kB of a file/blob is not sufficient; it
may give behavior incompatible with C git. C git considers the whole
blob; since it uses memory-mapped files it can do so with acceptable
performance. Doing this in JGit would most likely incur a noticeable
performance penalty. But 8kB is a bit small; in the file in bug 576971
the limit was hit before the first CR-LF, which occurred on line 155
at offset 9759 in the file.

Make RawText.FIRST_FEW_BYTES only a default and minimum setting, and
set it to 8KiB. Make the actual buffer size configurable: provide
static methods getBufferSize() and setBuffersize(), and use
getBufferSize() throughout instead of the constant.

This enables users of the JGit library to set their own possibly larger
buffer size.

Bug: 576971
Change-Id: I447762c9a5147a521f73d2864ba59ed89f555d54
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2021-10-30 23:05:22 +02:00
..
CherryPickTest.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
CrissCrossMergeTest.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
GitlinkMergeTest.java GitlinkMergeTest: fix boxing warnings 2020-09-05 23:28:06 +02:00
MergeAlgorithmTest.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
MergeMessageFormatterTest.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00
MergerTest.java Make the buffer size for text/binary detection configurable 2021-10-30 23:05:22 +02:00
SimpleMergeTest.java SimpleMergeTest: Clean up code style 2020-06-10 11:35:58 +09:00
SquashMessageFormatterTest.java Update EDL 1.0 license headers to new short SPDX compliant format 2020-01-04 01:10:05 +01:00