list-objects: pass full pathname to callbacks
[gitweb.git] / bisect.c
index 053d1a2ab91a6c41a0fe957569ff905d12b00bee..06ec54e599586f7cfe0f08c4b63354900af33d18 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -193,7 +193,7 @@ static int compare_commit_dist(const void *a_, const void *b_)
        b = (struct commit_dist *)b_;
        if (a->distance != b->distance)
                return b->distance - a->distance; /* desc sort */
-       return hashcmp(a->commit->object.sha1, b->commit->object.sha1);
+       return oidcmp(&a->commit->object.oid, &b->commit->object.oid);
 }
 
 static struct commit_list *best_bisection_sorted(struct commit_list *list, int nr)
@@ -440,7 +440,7 @@ static void read_bisect_paths(struct argv_array *array)
        if (!fp)
                die_errno("Could not open file '%s'", filename);
 
-       while (strbuf_getline(&str, fp, '\n') != EOF) {
+       while (strbuf_getline_lf(&str, fp) != EOF) {
                strbuf_trim(&str);
                if (sq_dequote_to_argv_array(str.buf, array))
                        die("Badly quoted content in file '%s': %s",
@@ -500,7 +500,7 @@ struct commit_list *filter_skipped(struct commit_list *list,
                struct commit_list *next = list->next;
                list->next = NULL;
                if (0 <= sha1_array_lookup(&skipped_revs,
-                                          list->item->object.sha1)) {
+                                          list->item->object.oid.hash)) {
                        if (skipped_first && !*skipped_first)
                                *skipped_first = 1;
                        /* Move current to tried list */
@@ -575,7 +575,7 @@ static struct commit_list *skip_away(struct commit_list *list, int count)
 
        for (i = 0; cur; cur = cur->next, i++) {
                if (i == index) {
-                       if (hashcmp(cur->item->object.sha1, current_bad_oid->hash))
+                       if (oidcmp(&cur->item->object.oid, current_bad_oid))
                                return cur;
                        if (previous)
                                return previous;
@@ -668,7 +668,7 @@ static int is_expected_rev(const struct object_id *oid)
        if (!fp)
                return 0;
 
-       if (strbuf_getline(&str, fp, '\n') != EOF)
+       if (strbuf_getline_lf(&str, fp) != EOF)
                res = !strcmp(str.buf, oid_to_hex(oid));
 
        strbuf_release(&str);
@@ -784,7 +784,7 @@ static void check_merge_bases(int no_checkout)
        result = get_merge_bases_many(rev[0], rev_nr - 1, rev + 1);
 
        for (; result; result = result->next) {
-               const unsigned char *mb = result->item->object.sha1;
+               const unsigned char *mb = result->item->object.oid.hash;
                if (!hashcmp(mb, current_bad_oid->hash)) {
                        handle_bad_merge_base();
                } else if (0 <= sha1_array_lookup(&good_revs, mb)) {
@@ -914,9 +914,9 @@ void read_bisect_terms(const char **read_bad, const char **read_good)
                                strerror(errno));
                }
        } else {
-               strbuf_getline(&str, fp, '\n');
+               strbuf_getline_lf(&str, fp);
                *read_bad = strbuf_detach(&str, NULL);
-               strbuf_getline(&str, fp, '\n');
+               strbuf_getline_lf(&str, fp);
                *read_good = strbuf_detach(&str, NULL);
        }
        strbuf_release(&str);
@@ -973,7 +973,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
                exit(4);
        }
 
-       bisect_rev = revs.commits->item->object.sha1;
+       bisect_rev = revs.commits->item->object.oid.hash;
 
        if (!hashcmp(bisect_rev, current_bad_oid->hash)) {
                exit_if_skipped_commits(tried, current_bad_oid);