|
|
@ -500,7 +500,7 @@ public class DfsInserter extends ObjectInserter { |
|
|
|
inf.setInput(currBuf, s, n); |
|
|
|
inf.setInput(currBuf, s, n); |
|
|
|
return n; |
|
|
|
return n; |
|
|
|
} |
|
|
|
} |
|
|
|
throw new EOFException(DfsText.get().unexpectedEofInPack); |
|
|
|
throw new EOFException(JGitText.get().unexpectedEofInPack); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private DfsBlock getOrLoadBlock(long pos) throws IOException { |
|
|
|
private DfsBlock getOrLoadBlock(long pos) throws IOException { |
|
|
@ -513,7 +513,7 @@ public class DfsInserter extends ObjectInserter { |
|
|
|
for (int p = 0; p < blockSize;) { |
|
|
|
for (int p = 0; p < blockSize;) { |
|
|
|
int n = out.read(s + p, ByteBuffer.wrap(d, p, blockSize - p)); |
|
|
|
int n = out.read(s + p, ByteBuffer.wrap(d, p, blockSize - p)); |
|
|
|
if (n <= 0) |
|
|
|
if (n <= 0) |
|
|
|
throw new EOFException(DfsText.get().unexpectedEofInPack); |
|
|
|
throw new EOFException(JGitText.get().unexpectedEofInPack); |
|
|
|
p += n; |
|
|
|
p += n; |
|
|
|
} |
|
|
|
} |
|
|
|
b = new DfsBlock(packKey, s, d); |
|
|
|
b = new DfsBlock(packKey, s, d); |
|
|
@ -569,13 +569,13 @@ public class DfsInserter extends ObjectInserter { |
|
|
|
byte[] buf = buffer(); |
|
|
|
byte[] buf = buffer(); |
|
|
|
int cnt = packOut.read(obj.getOffset(), buf, 0, 20); |
|
|
|
int cnt = packOut.read(obj.getOffset(), buf, 0, 20); |
|
|
|
if (cnt <= 0) |
|
|
|
if (cnt <= 0) |
|
|
|
throw new EOFException(DfsText.get().unexpectedEofInPack); |
|
|
|
throw new EOFException(JGitText.get().unexpectedEofInPack); |
|
|
|
|
|
|
|
|
|
|
|
int c = buf[0] & 0xff; |
|
|
|
int c = buf[0] & 0xff; |
|
|
|
int type = (c >> 4) & 7; |
|
|
|
int type = (c >> 4) & 7; |
|
|
|
if (type == OBJ_OFS_DELTA || type == OBJ_REF_DELTA) |
|
|
|
if (type == OBJ_OFS_DELTA || type == OBJ_REF_DELTA) |
|
|
|
throw new IOException(MessageFormat.format( |
|
|
|
throw new IOException(MessageFormat.format( |
|
|
|
DfsText.get().cannotReadBackDelta, Integer.toString(type))); |
|
|
|
JGitText.get().cannotReadBackDelta, Integer.toString(type))); |
|
|
|
if (typeHint != OBJ_ANY && type != typeHint) { |
|
|
|
if (typeHint != OBJ_ANY && type != typeHint) { |
|
|
|
throw new IncorrectObjectTypeException(objectId.copy(), typeHint); |
|
|
|
throw new IncorrectObjectTypeException(objectId.copy(), typeHint); |
|
|
|
} |
|
|
|
} |
|
|
@ -585,7 +585,7 @@ public class DfsInserter extends ObjectInserter { |
|
|
|
int shift = 4; |
|
|
|
int shift = 4; |
|
|
|
while ((c & 0x80) != 0) { |
|
|
|
while ((c & 0x80) != 0) { |
|
|
|
if (ptr >= cnt) |
|
|
|
if (ptr >= cnt) |
|
|
|
throw new EOFException(DfsText.get().unexpectedEofInPack); |
|
|
|
throw new EOFException(JGitText.get().unexpectedEofInPack); |
|
|
|
c = buf[ptr++] & 0xff; |
|
|
|
c = buf[ptr++] & 0xff; |
|
|
|
sz += ((long) (c & 0x7f)) << shift; |
|
|
|
sz += ((long) (c & 0x7f)) << shift; |
|
|
|
shift += 7; |
|
|
|
shift += 7; |
|
|
|