summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-07-07 08:34:57 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-07-07 08:53:03 -0700
commita215914a5638726ab4533332e97d6abe6e7e9657 (patch)
treede77f1d1ffe93c5c0574b02e66b9d0cd3b6282b9
parentf29741d1d86ea9baa7a37545da29be38a9d1af02 (diff)
downloadjgit-a215914a5638726ab4533332e97d6abe6e7e9657.tar.gz
jgit-a215914a5638726ab4533332e97d6abe6e7e9657.zip
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>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/DeltaEncoder.java2
1 files changed, 1 insertions, 1 deletions
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;
}