aboutsummaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-25 11:08:47 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-25 11:08:47 -0800
commit2c7ca1fcf19d3803a225130491e26dca86d1781d (patch)
treea123f8cce38b69141bc011dad157c94d3781b779 /builtin-pack-objects.c
parent7bd59dee5b4b42f2ed233141e33713a7f012dd22 (diff)
parentd2dc6222d4e2f7fa5efc82175d14d60d7b804687 (diff)
downloadgit-2c7ca1fcf19d3803a225130491e26dca86d1781d.tar.gz
git-2c7ca1fcf19d3803a225130491e26dca86d1781d.tar.xz
Merge branch 'maint'
* maint: Add Release Notes to prepare for 1.5.0.2 Allow arbitrary number of arguments to git-pack-objects rerere: do not deal with symlinks. rerere: do not skip two conflicted paths next to each other. Don't modify CREDITS-FILE if it hasn't changed.
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index b5ed9ce2c..426ffddff 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1551,9 +1551,12 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
int use_internal_rev_list = 0;
int thin = 0;
int i;
- const char *rp_av[64];
+ const char **rp_av;
+ int rp_ac_alloc = 64;
int rp_ac;
+ rp_av = xcalloc(rp_ac_alloc, sizeof(*rp_av));
+
rp_av[0] = "pack-objects";
rp_av[1] = "--objects"; /* --thin will make it --objects-edge */
rp_ac = 2;
@@ -1626,8 +1629,11 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
!strcmp("--reflog", arg) ||
!strcmp("--all", arg)) {
use_internal_rev_list = 1;
- if (ARRAY_SIZE(rp_av) - 1 <= rp_ac)
- die("too many internal rev-list options");
+ if (rp_ac >= rp_ac_alloc - 1) {
+ rp_ac_alloc = alloc_nr(rp_ac_alloc);
+ rp_av = xrealloc(rp_av,
+ rp_ac_alloc * sizeof(*rp_av));
+ }
rp_av[rp_ac++] = arg;
continue;
}