get_remote_url(): use the same data source as ls-remote to get remote urls
[gitweb.git] / builtin / branch.c
index 0cad20bb5a8bd0054761861aada7f1077260dbd5..9e546e4a83d07dd6dd4d4b0cb7d23a02c82747fb 100644 (file)
@@ -313,12 +313,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,
                                           (struct object *)commit, refname);
        }
 
-       /* Resize buffer */
-       if (ref_list->index >= ref_list->alloc) {
-               ref_list->alloc = alloc_nr(ref_list->alloc);
-               ref_list->list = xrealloc(ref_list->list,
-                               ref_list->alloc * sizeof(struct ref_item));
-       }
+       ALLOC_GROW(ref_list->list, ref_list->index + 1, ref_list->alloc);
 
        /* Record the new item */
        newitem = &(ref_list->list[ref_list->index++]);