Signed-off-by: Dmitry S. Dolzhenko <dmitrys.dolzhe...@yandex.ru>
---
 commit.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/commit.c b/commit.c
index 6bf4fe0..e004314 100644
--- a/commit.c
+++ b/commit.c
@@ -147,12 +147,8 @@ int register_commit_graft(struct commit_graft *graft, int 
ignore_dups)
                return 1;
        }
        pos = -pos - 1;
-       if (commit_graft_alloc <= ++commit_graft_nr) {
-               commit_graft_alloc = alloc_nr(commit_graft_alloc);
-               commit_graft = xrealloc(commit_graft,
-                                       sizeof(*commit_graft) *
-                                       commit_graft_alloc);
-       }
+       ALLOC_GROW(commit_graft, commit_graft_nr + 1, commit_graft_alloc);
+       commit_graft_nr++;
        if (pos < commit_graft_nr)
                memmove(commit_graft + pos + 1,
                        commit_graft + pos,
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to