pack-objects: move 'layer' into 'struct packing_data'
[gitweb.git] / pack-objects.c
index 92708522e76b4565882177f899612d72a3f6d75a..98389460c2dc49c198313d1b961adffcece9120d 100644 (file)
@@ -160,6 +160,12 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
 
                if (!pdata->in_pack_by_idx)
                        REALLOC_ARRAY(pdata->in_pack, 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++;
@@ -175,5 +181,11 @@ 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;
 }