aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-08-30 11:01:33 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-08-30 11:40:01 -0700
commita3945d1bc856322becdc4d1ec8df9013bfef3175 (patch)
tree51ee9b38ce4729f5ac74e0108fffae0c82a383f3 /org.eclipse.jgit/src/org/eclipse/jgit
parent1709800f277460a75d69c453e127c2d8ad40c945 (diff)
downloadjgit-a3945d1bc856322becdc4d1ec8df9013bfef3175.tar.gz
jgit-a3945d1bc856322becdc4d1ec8df9013bfef3175.zip
IndexPack: Use byte limited form of getCachedBytes
Currently our algorithm requires that we have the delta base as a contiguous byte array... but getCachedBytes() might not work if the object is considered to be large by its underlying loader. Use the limited form to obtain the object as a byte array instead. Change-Id: I33f12a8811cb6a4a67396174733f209db8119b42 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
index 2daa105c53..f5cdac9883 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
@@ -613,7 +613,7 @@ public class IndexPack {
missing.add(baseId);
continue;
}
- final byte[] data = ldr.getCachedBytes();
+ final byte[] data = ldr.getCachedBytes(Integer.MAX_VALUE);
final int typeCode = ldr.getType();
final PackedObjectInfo oe;
@@ -870,7 +870,7 @@ public class IndexPack {
try {
final ObjectLoader ldr = readCurs.open(id, type);
- final byte[] existingData = ldr.getCachedBytes();
+ final byte[] existingData = ldr.getCachedBytes(Integer.MAX_VALUE);
if (!Arrays.equals(data, existingData)) {
throw new IOException(MessageFormat.format(JGitText.get().collisionOn, id.name()));
}