grep.c: remove implicit dependency on the_index
[gitweb.git] / pack-objects.c
index 08cfe68b6befe673abe78f99bd3d976449ce0152..6ef87e5683aacdf738c86679712078988c0899fd 100644 (file)
@@ -60,7 +60,7 @@ static void rehash_objects(struct packing_data *pdata)
                                                       &found);
 
                if (found)
-                       die("BUG: Duplicate object in hash");
+                       BUG("Duplicate object in hash");
 
                pdata->index[ix] = i + 1;
                entry++;
@@ -143,6 +143,11 @@ void prepare_packing_data(struct packing_data *pdata)
        } else {
                prepare_in_pack_by_idx(pdata);
        }
+
+       pdata->oe_size_limit = git_env_ulong("GIT_TEST_OE_SIZE",
+                                            1U << OE_SIZE_BITS);
+       pdata->oe_delta_size_limit = git_env_ulong("GIT_TEST_OE_DELTA_SIZE",
+                                                  1UL << OE_DELTA_SIZE_BITS);
 }
 
 struct object_entry *packlist_alloc(struct packing_data *pdata,
@@ -157,6 +162,8 @@ 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->delta_size)
+                       REALLOC_ARRAY(pdata->delta_size, pdata->nr_alloc);
        }
 
        new_entry = pdata->objects + pdata->nr_objects++;