Browse Source

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 <spearce@spearce.org>
stable-0.9
Shawn O. Pearce 15 years ago
parent
commit
a215914a56
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java

2
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;
}

Loading…
Cancel
Save