Merge branch 'nd/bisect-show-list-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2018 20:54:00 +0000 (13:54 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Sep 2018 20:54:00 +0000 (13:54 -0700)
Debugging aid update.

* nd/bisect-show-list-fix:
bisect.c: make show_list() build again

1  2 
bisect.c
diff --combined bisect.c
index 958e72c6b902730cdeec0e4696e44635f072f1b2,e65f6821b81b827b5f75eb1ff21106fb37a4a8eb..e8b17cf7e1d8d2bf7895e2fa33d0cf0cbc47ae63
+++ b/bisect.c
@@@ -13,7 -13,7 +13,8 @@@
  #include "sha1-array.h"
  #include "argv-array.h"
  #include "commit-slab.h"
 +#include "commit-reach.h"
+ #include "object-store.h"
  
  static struct oid_array good_revs;
  static struct oid_array skipped_revs;
@@@ -121,14 -121,14 +122,14 @@@ static inline int halfway(struct commit
        }
  }
  
- #if !DEBUG_BISECT
- #define show_list(a,b,c,d) do { ; } while (0)
- #else
  static void show_list(const char *debug, int counted, int nr,
                      struct commit_list *list)
  {
        struct commit_list *p;
  
+       if (!DEBUG_BISECT)
+               return;
        fprintf(stderr, "%s (%d/%d)\n", debug, counted, nr);
  
        for (p = list; p; p = p->next) {
                        (flags & TREESAME) ? ' ' : 'T',
                        (flags & UNINTERESTING) ? 'U' : ' ',
                        (flags & COUNTED) ? 'C' : ' ');
-               if (commit->util)
+               if (*commit_weight_at(&commit_weight, p->item))
                        fprintf(stderr, "%3d", weight(p));
                else
                        fprintf(stderr, "---");
                fprintf(stderr, "\n");
        }
  }
- #endif /* DEBUG_BISECT */
  
  static struct commit_list *best_bisection(struct commit_list *list, int nr)
  {
@@@ -596,7 -595,7 +596,7 @@@ static struct commit_list *skip_away(st
  
        for (i = 0; cur; cur = cur->next, i++) {
                if (i == index) {
 -                      if (oidcmp(&cur->item->object.oid, current_bad_oid))
 +                      if (!oideq(&cur->item->object.oid, current_bad_oid))
                                return cur;
                        if (previous)
                                return previous;
@@@ -808,7 -807,7 +808,7 @@@ static void check_merge_bases(int rev_n
  
        for (; result; result = result->next) {
                const struct object_id *mb = &result->item->object.oid;
 -              if (!oidcmp(mb, current_bad_oid)) {
 +              if (oideq(mb, current_bad_oid)) {
                        handle_bad_merge_base();
                } else if (0 <= oid_array_lookup(&good_revs, mb)) {
                        continue;
@@@ -989,7 -988,7 +989,7 @@@ int bisect_next_all(const char *prefix
  
        bisect_rev = &revs.commits->item->object.oid;
  
 -      if (!oidcmp(bisect_rev, current_bad_oid)) {
 +      if (oideq(bisect_rev, current_bad_oid)) {
                exit_if_skipped_commits(tried, current_bad_oid);
                printf("%s is the first %s commit\n", oid_to_hex(bisect_rev),
                        term_bad);