From: Shawn O. Pearce Date: Wed, 7 Jul 2010 15:34:57 +0000 (-0700) Subject: Fix DeltaEncoder header for objects 128 bytes long X-Git-Tag: v0.9.1~157^2~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F1097%2F1;p=jgit.git Fix DeltaEncoder header for objects 128 bytes long The encode loop had the wrong condition, objects that are 128 bytes in size need to have their length encoded as two bytes, not one. Change-Id: I3bef85f2b774871ba6104042b341749eb8e7595c Signed-off-by: Shawn O. Pearce --- diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java index 7d4f62fc1b..7bf0bace74 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java @@ -81,7 +81,7 @@ public class DeltaEncoder { private void writeVarint(long sz) throws IOException { int p = 0; - while (sz > 0x80) { + while (sz >= 0x80) { buf[p++] = (byte) (0x80 | (((int) sz) & 0x7f)); sz >>>= 7; }