]> source.dussan.org Git - jgit.git/commitdiff
Fix DeltaEncoder header for objects 128 bytes long 97/1097/1
authorShawn O. Pearce <spearce@spearce.org>
Wed, 7 Jul 2010 15:34:57 +0000 (08:34 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 7 Jul 2010 15:53:03 +0000 (08:53 -0700)
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 <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java

index 7d4f62fc1b034ce357be649fd735c0035d809fc3..7bf0bace74323354cfbe1006c8108f908cf1bebf 100644 (file)
@@ -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;
                }