From a215914a5638726ab4533332e97d6abe6e7e9657 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Wed, 7 Jul 2010 08:34:57 -0700 Subject: [PATCH] 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 --- .../src/org/eclipse/jgit/storage/pack/DeltaEncoder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5