Merge branch 'maint'
authorJunio C Hamano <junkio@cox.net>
Sun, 25 Feb 2007 19:08:47 +0000 (11:08 -0800)
committerJunio C Hamano <junkio@cox.net>
Sun, 25 Feb 2007 19:08:47 +0000 (11:08 -0800)
* 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.

1  2 
builtin-pack-objects.c
builtin-rerere.c
diff --combined builtin-pack-objects.c
index b5ed9ce2c89daab7a69d399a6599e203dc04971a,971388276a66090bb2bb12475e9e714b54bf4898..426ffddfff01bbdae1132cef1a875c61ed1c80e7
@@@ -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;
                        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)
                        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 dd1d4c1c1de310629282bcb772139e1edec22bf4,58c5fed91d9d8f2f0fd573f5621344f795f1c11c..b8867ab4add83dee4ab99108e96949bcd65290a0
@@@ -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;