update-ref.c: extract a new function, parse_next_sha1()
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 70eefdd350429cc2a9a9238449b315512d189451..99f53033ba174301437c65b1dfa8f8cceb74f517 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -1364,10 +1364,7 @@ static struct path_simplify *create_simplify(const char **pathspec)
 
        for (nr = 0 ; ; nr++) {
                const char *match;
-               if (nr >= alloc) {
-                       alloc = alloc_nr(alloc);
-                       simplify = xrealloc(simplify, alloc * sizeof(*simplify));
-               }
+               ALLOC_GROW(simplify, nr + 1, alloc);
                match = *pathspec++;
                if (!match)
                        break;