mingw: fix getcwd when the parent directory cannot be queried
[gitweb.git] / bisect.c
index 958e72c6b902730cdeec0e4696e44635f072f1b2..487675c67249a3164294aae71c1c2a650f3c4947 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -14,6 +14,7 @@
 #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 +122,14 @@ static inline int halfway(struct commit_list *p, int nr)
        }
 }
 
-#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) {
@@ -146,7 +147,7 @@ static void show_list(const char *debug, int counted, int nr,
                        (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, "---");
@@ -161,7 +162,6 @@ static void show_list(const char *debug, int counted, int nr,
                fprintf(stderr, "\n");
        }
 }
-#endif /* DEBUG_BISECT */
 
 static struct commit_list *best_bisection(struct commit_list *list, int nr)
 {
@@ -633,7 +633,7 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix,
        struct argv_array rev_argv = ARGV_ARRAY_INIT;
        int i;
 
-       init_revisions(revs, prefix);
+       repo_init_revisions(the_repository, revs, prefix);
        revs->abbrev = 0;
        revs->commit_format = CMIT_FMT_UNSPECIFIED;
 
@@ -890,7 +890,7 @@ static void show_diff_tree(const char *prefix, struct commit *commit)
        struct rev_info opt;
 
        /* diff-tree init */
-       init_revisions(&opt, prefix);
+       repo_init_revisions(the_repository, &opt, prefix);
        git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
        opt.abbrev = 0;
        opt.diff = 1;