Cached packs are only used when writing over the network or to
a bundle file and reuse validation is always disabled in these
two contexts. The client/consumer of the stream will be SHA-1
checksumming every object.
Reuse validation is most critical during local GC to avoid silently
ignoring corruption by stopping as soon as a problem is found and
leaving everything alone for the end-user to debug and salvage.
Cached packs are not supported during local GC as the bitmap rebuild
logic does not support including a cached pack in the result.
Strip out the validation and force PackWriter to always disable the
cached pack feature if reuseValidation is enabled.
Change-Id: If0d7baf2ae1bf1f7e71bf773151302c9f7887039
Sensible suggestion from Terry Parker as a late comment on
commit f2efcdc6f769d59722b17e9274932d585035cfb6.
Change-Id: I225775bfb6d3d91ae066ff00f9d80a9c02a422c2
This hint allows an underlying implementation to read more bytes when
possible and buffer them locally for future read calls to consume.
Change-Id: Ia986a1bb8640eecb91cfbd515c61fa1ff1574a6f
When a large pack (> 30% of the block cache) is being reused by
copying it pollutes the block cache with noise by storing blocks
that are never referenced again.
Avoid this by streaming the file directly from its channel onto
the output stream.
Change-Id: I2e53de27f3dcfb93de68b1fad45f75ab23e79fe7
The clone or fetch depth is a valuable bit of information
for access logging. Create a public getter to faciliate access.
A precondition check prevents unintentional misuse when the
data isn't valid yet.
Change-Id: I4603d5fd3bd4a767e3e2419b0f2da3664cfbd7f8
Signed-off-by: David Pletcher <dpletcher@google.com>
This was deprecated and should only be used by DirCacheCheckout and
friends. Other classes should use SystemReader.checkPath() instead.
Change-Id: I37cf753b1f081602dee9f0f47979eff39d735f92
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
- close RevWalk allocated in scan()
- replace use of deprecated ObjectReader.release() method
Change-Id: I41b2b10a1a44270a6ceaa1741e996c0921439852
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Replaces use of deprecated release() methods.
Change-Id: I0211bcf0a76a2fccc2c85fa74778e20c256984ba
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
- replaces use of deprecated ObjectInserter.release()
- auto-close TreeWalk
Change-Id: I540ee711b8c3430a71fdff07add506b7d9c039dc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Most callers/users of TemporaryBuffer are sizing the in-memory
portion large enough that most outputs fit into RAM. With this
assumption they don't pay close attention to the size of IOs
being written, as it "should" just be a copy from one byte array
to another.
Overflow sets up a local file handle, which is costly to write to
for small IO units. Wrap the local file in a BufferedOutputStream
to combine small writes together. Larger writes can still bypass the
buffer as BOS automatically avoids copying for larger writes.
Change-Id: I09f4136dd65c48830cfda86d9101bc647581018a
When reading back from an overflowed TemporaryBuffer the InputStream
must be closed to close the FileInputStream that is reading from
the backing file.
Change-Id: Id83d8f16f5b2c2618a9f841ec3508508455a6ae1
By writing the temporary overflow merge result to $GIT_DIR JGit
can ensure the same filesystem permissions apply to protect the
file contents.
If no directory is available from the repository (e.g. DfsRepository)
null will be passed and the system temporary directory will be used
instead.
Change-Id: I95532aa092676d18f1dc1e3fdbe6dcb1f91b782e