Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Wed, 1 Aug 2007 04:12:32 +0000 (21:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Aug 2007 04:12:32 +0000 (21:12 -0700)
* maint:
rev-list --bisect: fix allocation of "int*" instead of "int".

1  2 
builtin-rev-list.c
diff --combined builtin-rev-list.c
index 8efd609b12e3c8cf20fbe1bf5c0d55643d34ea3c,2eb919f39cfe589bf7cfa8c77ec9b1ae29676efe..ac551d59f3f6cb209a645ad708c46e4e88791295
@@@ -70,9 -70,21 +70,9 @@@ static void show_commit(struct commit *
        if (revs.parents) {
                struct commit_list *parents = commit->parents;
                while (parents) {
 -                      struct object *o = &(parents->item->object);
 +                      printf(" %s", sha1_to_hex(parents->item->object.sha1));
                        parents = parents->next;
 -                      if (o->flags & TMP_MARK)
 -                              continue;
 -                      printf(" %s", sha1_to_hex(o->sha1));
 -                      o->flags |= TMP_MARK;
                }
 -              /* TMP_MARK is a general purpose flag that can
 -               * be used locally, but the user should clean
 -               * things up after it is done with them.
 -               */
 -              for (parents = commit->parents;
 -                   parents;
 -                   parents = parents->next)
 -                      parents->item->object.flags &= ~TMP_MARK;
        }
        if (revs.commit_format == CMIT_FMT_ONELINE)
                putchar(' ');
                putchar('\n');
  
        if (revs.verbose_header) {
 -              static char pretty_header[16384];
 +              char *buf = NULL;
 +              unsigned long buflen = 0;
                pretty_print_commit(revs.commit_format, commit, ~0,
 -                                  pretty_header, sizeof(pretty_header),
 +                                  &buf, &buflen,
                                    revs.abbrev, NULL, NULL, revs.date_mode);
 -              printf("%s%c", pretty_header, hdr_termination);
 +              printf("%s%c", buf, hdr_termination);
 +              free(buf);
        }
 -      fflush(stdout);
 +      maybe_flush_or_die(stdout, "stdout");
        if (commit->parents) {
                free_commit_list(commit->parents);
                commit->parents = NULL;
@@@ -300,7 -310,7 +300,7 @@@ static struct commit_list *find_bisecti
        show_list("bisection 2 sorted", 0, nr, list);
  
        *all = nr;
-       weights = xcalloc(on_list, sizeof(int*));
+       weights = xcalloc(on_list, sizeof(*weights));
        counted = 0;
  
        for (n = 0, p = list; p; p = p->next) {