]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bundle.c
Update draft release notes for 2.0
[thirdparty/git.git] / bundle.c
index e99065ce425ad6e816d946626ef83075ab70bf85..1222952075fe4c9f3c25373123d8793b7c1692ef 100644 (file)
--- a/bundle.c
+++ b/bundle.c
@@ -14,12 +14,8 @@ 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]));
-       }
-       memcpy(list->list[list->nr].sha1, sha1, 20);
+       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++;
 }
@@ -124,6 +120,7 @@ static int list_refs(struct ref_list *r, int argc, const char **argv)
        return 0;
 }
 
+/* Remember to update object flag allocation in object.h */
 #define PREREQ_MARK (1u<<16)
 
 int verify_bundle(struct bundle_header *header, int verbose)