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>
This commit is contained in:
parent
1709800f27
commit
a3945d1bc8
|
@ -613,7 +613,7 @@ private void fixThinPack(final ProgressMonitor progress) throws IOException {
|
|||
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 @@ private void verifySafeObject(final AnyObjectId id, final int type,
|
|||
|
||||
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()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue