aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-06-28 16:49:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-28 17:12:18 -0700
commite1ddc9768469cb8c25387dc0c75dd4f40ea71096 (patch)
tree8ed42f494d2c3a7643cb3a3e70115bb3a96a73d7
parentfead2836a16829fba427635f92d7df9acf771a55 (diff)
downloadgit-e1ddc9768469cb8c25387dc0c75dd4f40ea71096.tar.gz
git-e1ddc9768469cb8c25387dc0c75dd4f40ea71096.tar.xz
[PATCH] Fix unpack-objects for header length information.
Standalone unpack-objects command was not adjusted for header length encoding change when dealing with deltified entry. This fixes it. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--pack-objects.c6
-rw-r--r--unpack-objects.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/pack-objects.c b/pack-objects.c
index d1e62dc01..36f515b73 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -97,9 +97,9 @@ static unsigned long write_object(struct sha1file *f, struct object_entry *entry
die("object %s size inconsistency (%lu vs %lu)", sha1_to_hex(entry->sha1), size, entry->size);
/*
- * The object header is a byte of 'type' followed by four bytes of
- * length, except for deltas that has the 20 bytes of delta sha
- * instead.
+ * The object header is a byte of 'type' followed by zero or
+ * more bytes of length. For deltas, the 20 bytes of delta sha1
+ * follows that.
*/
obj_type = entry->type;
if (entry->delta) {
diff --git a/unpack-objects.c b/unpack-objects.c
index 98b696cf2..fbc899408 100644
--- a/unpack-objects.c
+++ b/unpack-objects.c
@@ -271,7 +271,7 @@ static void unpack_entry(struct pack_entry *entry)
unpack_non_delta_entry(entry, type, pack, size, left);
return;
case OBJ_DELTA:
- unpack_delta_entry(entry, pack+5, size, left);
+ unpack_delta_entry(entry, pack, size, left);
return;
}
bad: