diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-09-17 23:53:55 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 23:53:55 +0300 |
commit | f3504ea3dd21b0a6d38bcd369efa0663cdc05416 (patch) | |
tree | c8eb1191474dc37e25f082917e803915525c15d1 /pack-objects.c | |
parent | fba9654364a523bf146df26052ab05dd52c1d719 (diff) | |
parent | fe0ac2fb7f8e87d37ef83dcee2d93901d58d8277 (diff) |
Merge branch 'cc/delta-islands'
Lift code from GitHub to restrict delta computation so that an
object that exists in one fork is not made into a delta against
another object that does not appear in the same forked repository.
* cc/delta-islands:
pack-objects: move 'layer' into 'struct packing_data'
pack-objects: move tree_depth into 'struct packing_data'
t5320: tests for delta islands
repack: add delta-islands support
pack-objects: add delta-islands support
pack-objects: refactor code into compute_layer_order()
Add delta-islands.{c,h}
Diffstat (limited to 'pack-objects.c')
-rw-r--r-- | pack-objects.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pack-objects.c b/pack-objects.c index 34628587725..7f7b7dddf69 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -164,6 +164,12 @@ struct object_entry *packlist_alloc(struct packing_data *pdata, REALLOC_ARRAY(pdata->in_pack, pdata->nr_alloc); if (pdata->delta_size) REALLOC_ARRAY(pdata->delta_size, pdata->nr_alloc); + + if (pdata->tree_depth) + REALLOC_ARRAY(pdata->tree_depth, pdata->nr_alloc); + + if (pdata->layer) + REALLOC_ARRAY(pdata->layer, pdata->nr_alloc); } new_entry = pdata->objects + pdata->nr_objects++; @@ -179,6 +185,12 @@ struct object_entry *packlist_alloc(struct packing_data *pdata, if (pdata->in_pack) pdata->in_pack[pdata->nr_objects - 1] = NULL; + if (pdata->tree_depth) + pdata->tree_depth[pdata->nr_objects - 1] = 0; + + if (pdata->layer) + pdata->layer[pdata->nr_objects - 1] = 0; + return new_entry; } |