From: Junio C Hamano Date: Sun, 25 Feb 2007 19:08:47 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.1-rc1~134 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2c7ca1fcf19d3803a225130491e26dca86d1781d?ds=inline;hp=-c 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. --- 2c7ca1fcf19d3803a225130491e26dca86d1781d diff --combined builtin-pack-objects.c index b5ed9ce2c8,971388276a..426ffddfff --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@@ -1551,9 -1551,12 +1551,12 @@@ int cmd_pack_objects(int argc, const ch 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; @@@ -1579,14 -1582,14 +1582,14 @@@ incremental = 1; continue; } - if (!strncmp("--window=", arg, 9)) { + if (!prefixcmp(arg, "--window=")) { char *end; window = strtoul(arg+9, &end, 0); if (!arg[9] || *end) usage(pack_usage); continue; } - if (!strncmp("--depth=", arg, 8)) { + if (!prefixcmp(arg, "--depth=")) { char *end; depth = strtoul(arg+8, &end, 0); if (!arg[8] || *end) @@@ -1622,12 -1625,15 +1625,15 @@@ continue; } if (!strcmp("--unpacked", arg) || - !strncmp("--unpacked=", arg, 11) || + !prefixcmp(arg, "--unpacked=") || !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; } diff --combined builtin-rerere.c index dd1d4c1c1d,58c5fed91d..b8867ab4ad --- a/builtin-rerere.c +++ b/builtin-rerere.c @@@ -105,11 -105,11 +105,11 @@@ static int handle_file(const char *path SHA1_Init(&ctx); while (fgets(buf, sizeof(buf), f)) { - if (!strncmp("<<<<<<< ", buf, 8)) + if (!prefixcmp(buf, "<<<<<<< ")) hunk = 1; - else if (!strncmp("=======", buf, 7)) + else if (!prefixcmp(buf, "=======")) hunk = 2; - else if (!strncmp(">>>>>>> ", buf, 8)) { + else if (!prefixcmp(buf, ">>>>>>> ")) { hunk_no++; hunk = 0; if (memcmp(one->ptr, two->ptr, one->nr < two->nr ? @@@ -154,13 -154,17 +154,17 @@@ static int find_conflict(struct path_li return error("Could not read index"); for (i = 0; i + 2 < active_nr; i++) { struct cache_entry *e1 = active_cache[i]; - struct cache_entry *e2 = active_cache[i + 1]; - struct cache_entry *e3 = active_cache[i + 2]; - if (ce_stage(e1) == 1 && ce_stage(e2) == 2 && - ce_stage(e3) == 3 && ce_same_name(e1, e2) && - ce_same_name(e1, e3)) { + struct cache_entry *e2 = active_cache[i+1]; + struct cache_entry *e3 = active_cache[i+2]; + if (ce_stage(e1) == 1 && + ce_stage(e2) == 2 && + ce_stage(e3) == 3 && + ce_same_name(e1, e2) && ce_same_name(e1, e3) && + S_ISREG(ntohl(e1->ce_mode)) && + S_ISREG(ntohl(e2->ce_mode)) && + S_ISREG(ntohl(e3->ce_mode))) { path_list_insert((const char *)e1->name, conflict); - i += 3; + i += 2; } } return 0;