Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk
An extra field type_valid is added to carry the equivalent of OBJ_BAD
in the original "type" field. in_pack_type always contains a valid
type so we only need 3 bits for it.
...
@@ -1570,7 +1576,7 @@ static void drop_reused_delta(struct object_entry *entry)
entry->depth = 0;
oi.sizep = &entry->size;
- oi.typep = &entry->type;
+ oi.typep = &type;
if (packed_object_info(entry->in_pack, entry->in_pack_offset, &oi) < 0) {
/*
* We failed to get the info from this pack for some reason;@@ -1578,8 +1584,10 @@ static void drop_reused_delta(struct object_entry *entry)
* And if that fails, the error will be recorded in entry->type
This "entry->type" needs updating.
* and dealt with in prepare_pack().
*/
- entry->type = sha1_object_info(entry->idx.oid.hash,
- &entry->size);
+ oe_set_type(entry, sha1_object_info(entry->idx.oid.hash,
+ &entry->size));
+ } else {
+ oe_set_type(entry, type);
}
}