]> source.dussan.org Git - jgit.git/commit
Add BlobObjectChecker 30/102830/4
authorMasaya Suzuki <masayasuzuki@google.com>
Thu, 10 Aug 2017 06:30:03 +0000 (23:30 -0700)
committerMasaya Suzuki <masayasuzuki@google.com>
Mon, 28 Aug 2017 15:42:27 +0000 (08:42 -0700)
commitfd74cf2f78c8e5c24792aa6b7b5df69d64018d09
tree04b32c8fd8c184a909a776145cb6088dd637e7e8
parent1b4daa2994a16bad5b9b77b24d8ce1f1d25f78fa
Add BlobObjectChecker

Some repositories can have a policy that do not accept certain blobs. To
check if the incoming pack file contains such blobs, ObjectChecker can
be used. However, this ObjectChecker is not called by PackParser if the
blob is stored as a whole. This is because the object can be so large
that it doesn't fit in memory.

This change introduces BlobObjectChecker. This interface takes chunks of
a blob instead of the entire object. ObjectChecker can optionally return
a BlobObjectChecker. This won't change existing ObjectChecker
implementation; existing implementation continues to receive deltified
blob objects only.

Change-Id: Ic33a92c2de42bd7a89786a4da26b7a648b25218d
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/BlobObjectChecker.java [new file with mode: 0644]
org.eclipse.jgit/src/org/eclipse/jgit/lib/ObjectChecker.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PackParser.java