summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-12-14 01:59:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-12-19 18:43:53 (GMT)
commitfcbc0d8e8216d7b6235eccf9f3b556455ad3be3d (patch)
tree6ba9307ee313b700097b123a3e7d6a92cb8a6715 /builtin
parent1b9743462d9ef3c0e73a3c439de45c0c16b6c938 (diff)
downloadgit-fcbc0d8e8216d7b6235eccf9f3b556455ad3be3d.zip
git-fcbc0d8e8216d7b6235eccf9f3b556455ad3be3d.tar.gz
git-fcbc0d8e8216d7b6235eccf9f3b556455ad3be3d.tar.bz2
builtin/branch.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/branch.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index 0cad20b..9e546e4 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -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++]);