Skip to content

Commit

Permalink
[PATCH] Fix unpack-objects for header length information.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano authored and Linus Torvalds committed Jun 29, 2005
1 parent fead283 commit e1ddc97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion unpack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit e1ddc97

Please sign in to comment.