|
|
|
@ -219,12 +219,12 @@ public class FsckPackParser extends PackParser {
|
|
|
|
|
if (bytes == null) { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
int offset = (int) (channelPosition - block * blockSize); |
|
|
|
|
int bytesToCopy = Math.min(cnt, bytes.length - offset); |
|
|
|
|
int offs = (int) (channelPosition - block * blockSize); |
|
|
|
|
int bytesToCopy = Math.min(cnt, bytes.length - offs); |
|
|
|
|
if (bytesToCopy < 1) { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
System.arraycopy(bytes, offset, dst, pos, bytesToCopy); |
|
|
|
|
System.arraycopy(bytes, offs, dst, pos, bytesToCopy); |
|
|
|
|
return bytesToCopy; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -277,13 +277,13 @@ public class FsckPackParser extends PackParser {
|
|
|
|
|
PackedObjectInfo entry = getObject(i); |
|
|
|
|
inPack.add(new ObjFromPack(entry)); |
|
|
|
|
|
|
|
|
|
long offset = idx.findOffset(entry); |
|
|
|
|
if (offset == -1) { |
|
|
|
|
long offs = idx.findOffset(entry); |
|
|
|
|
if (offs == -1) { |
|
|
|
|
throw new CorruptPackIndexException( |
|
|
|
|
MessageFormat.format(JGitText.get().missingObject, |
|
|
|
|
entry.getType(), entry.getName()), |
|
|
|
|
ErrorType.MISSING_OBJ); |
|
|
|
|
} else if (offset != entry.getOffset()) { |
|
|
|
|
} else if (offs != entry.getOffset()) { |
|
|
|
|
throw new CorruptPackIndexException(MessageFormat |
|
|
|
|
.format(JGitText.get().mismatchOffset, entry.getName()), |
|
|
|
|
ErrorType.MISMATCH_OFFSET); |
|
|
|
@ -317,11 +317,11 @@ public class FsckPackParser extends PackParser {
|
|
|
|
|
* Set the object count for overwriting the expected object count from pack |
|
|
|
|
* header. |
|
|
|
|
* |
|
|
|
|
* @param expectedObjectCount |
|
|
|
|
* @param objectCount |
|
|
|
|
* the actual expected object count. |
|
|
|
|
*/ |
|
|
|
|
public void overwriteObjectCount(long expectedObjectCount) { |
|
|
|
|
this.expectedObjectCount = expectedObjectCount; |
|
|
|
|
public void overwriteObjectCount(long objectCount) { |
|
|
|
|
this.expectedObjectCount = objectCount; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static class ObjFromPack extends ObjectIdOwnerMap.Entry { |
|
|
|
|