X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Frm.c;h=ff491d77612ffb3c906c5e1ffa232f4410e4b661;hb=302de7a685952cddd764bd3ccd427d0cd9e67fdf;hp=c7b7bb37a2378aaeeddbbdfacd0f0a62337ec152;hpb=38a5932be8a8f0b0bd3bb949bdc5258d9c753f15;p=git.git diff --git a/builtin/rm.c b/builtin/rm.c index c7b7bb37a..ff491d776 100644 --- a/builtin/rm.c +++ b/builtin/rm.c @@ -20,15 +20,6 @@ static struct { const char **name; } list; -static void add_list(const char *name) -{ - if (list.nr >= list.alloc) { - list.alloc = alloc_nr(list.alloc); - list.name = xrealloc(list.name, list.alloc * sizeof(const char *)); - } - list.name[list.nr++] = name; -} - static int check_local_mod(unsigned char *head, int index_only) { /* @@ -182,7 +173,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix) struct cache_entry *ce = active_cache[i]; if (!match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen)) continue; - add_list(ce->name); + ALLOC_GROW(list.name, list.nr + 1, list.alloc); + list.name[list.nr++] = ce->name; } if (pathspec) {