diff options
Diffstat (limited to 'pack-objects.h')
-rw-r--r-- | pack-objects.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/pack-objects.h b/pack-objects.h index 8eecd67991..3cb5527eeb 100644 --- a/pack-objects.h +++ b/pack-objects.h @@ -101,7 +101,6 @@ struct object_entry { unsigned no_try_delta:1; unsigned in_pack_type:TYPE_BITS; /* could be delta */ - unsigned int tree_depth; /* should be repositioned for packing? */ unsigned char layer; unsigned preferred_base:1; /* @@ -145,6 +144,9 @@ struct packing_data { struct packed_git **in_pack; uintmax_t oe_size_limit; + + /* delta islands */ + unsigned int *tree_depth; }; void prepare_packing_data(struct packing_data *pdata); @@ -350,4 +352,21 @@ static inline void oe_set_delta_size(struct packing_data *pack, "where delta size is the same as entry size"); } +static inline unsigned int oe_tree_depth(struct packing_data *pack, + struct object_entry *e) +{ + if (!pack->tree_depth) + return 0; + return pack->tree_depth[e - pack->objects]; +} + +static inline void oe_set_tree_depth(struct packing_data *pack, + struct object_entry *e, + unsigned int tree_depth) +{ + if (!pack->tree_depth) + ALLOC_ARRAY(pack->tree_depth, pack->nr_objects); + pack->tree_depth[e - pack->objects] = tree_depth; +} + #endif |