diff options
author | Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru> | 2014-03-04 02:31:50 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-04 02:44:48 +0400 |
commit | 5cbbe13a9f16e7ddebd186dbf1dddb16185b968f (patch) | |
tree | a75f459a1f4dd4b3bb9ffc1802c4eef9a9c1b481 | |
parent | 25e194070975d4410775e6db0165f4b3b9132bd3 (diff) |
bundle.c: use ALLOC_GROW() in add_to_ref_list()
Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | bundle.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -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); memcpy(list->list[list->nr].sha1, sha1, 20); list->list[list->nr].name = xstrdup(name); list->nr++; |