Fix corrupted large deltas

Large objects stored as deltas get unpacked by JGit into a loose
object, so they are cheaper to access later on.  This unpacking was
broken because TeeInputStream copied the wrong length into the loose
object, sometimes copying too many bytes into the result.  This
created a loose object that did not have the correct content, and
whose length did not match the length denoted in the object header.

Change-Id: I3ce1fd9f3dc5bd195249c7872b3bec49570424a2
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce 2010-10-10 18:48:15 -07:00
parent 782dbfc60f
commit 4522b07d0f
1 changed files with 1 additions and 1 deletions

View File

@ -110,7 +110,7 @@ public int read(byte[] b, int off, int len) throws IOException {
int n = src.read(b, off, len);
if (0 < n)
dst.write(b, off, len);
dst.write(b, off, n);
return n;
}