Re: [PATCH v7 02/13] pack-objects: turn type and in_pack_type to bitfields

2018-03-30 Thread Jeff King
On Sat, Mar 24, 2018 at 07:33:42AM +0100, Nguyễn Thái Ngọc Duy wrote: > +static inline void oe_set_type(struct object_entry *e, > +enum object_type type) > +{ > + if (type >= OBJ_ANY) > + die("BUG: OBJ_ANY cannot be set in pack-objects code"); A minor

[PATCH v7 02/13] pack-objects: turn type and in_pack_type to bitfields

2018-03-24 Thread Nguyễn Thái Ngọc Duy
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. A note about accepting OBJ_NONE as "valid" type. The function read_object_list_from_stdin() can pass this value [1] and it