update-index: teach --cacheinfo a new syntax "mode,sha1,path"
[gitweb.git] / bundle.c
index 7809fbb1698851fa929a288fd46d3b437e5113ac..a85e0e4532ad10934b3d9c510db9e26b338f14f1 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -14,11 +14,7 @@ static const char bundle_signature[] = "# v2 git bundle\n";
 static void add_to_ref_list(const unsigned char *sha1, const char *name,
                struct ref_list *list)
 {
-       if (list->nr + 1 >= list->alloc) {
-               list->alloc = alloc_nr(list->nr + 1);
-               list->list = xrealloc(list->list,
-                               list->alloc * sizeof(list->list[0]));
-       }
+       ALLOC_GROW(list->list, list->nr + 1, list->alloc);
        hashcpy(list->list[list->nr].sha1, sha1);
        list->list[list->nr].name = xstrdup(name);
        list->nr++;