summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry S. Dolzhenko <dmitrys.dolzhenko@yandex.ru>2014-03-04 02:31:50 +0400
committerJunio C Hamano <gitster@pobox.com>2014-03-03 14:44:48 -0800
commit5cbbe13a9f16e7ddebd186dbf1dddb16185b968f (patch)
treea75f459a1f4dd4b3bb9ffc1802c4eef9a9c1b481
parent25e194070975d4410775e6db0165f4b3b9132bd3 (diff)
downloadgit-5cbbe13a9f16e7ddebd186dbf1dddb16185b968f.tar.gz
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.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/bundle.c b/bundle.c
index e99065ce42..1388a3e6fd 100644
--- 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);
memcpy(list->list[list->nr].sha1, sha1, 20);
list->list[list->nr].name = xstrdup(name);
list->nr++;