revision.c: reduce implicit dependency the_repository
[gitweb.git] / commit.c
index add310d4231d4cc71068b64827dc041aae0bb011..449c1f4920cff631f5cf2479772c350c9b8b7325 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -342,7 +342,7 @@ struct tree *get_commit_tree(const struct commit *commit)
        if (commit->graph_pos == COMMIT_NOT_FROM_GRAPH)
                BUG("commit has NULL tree, but was not loaded from commit-graph");
 
-       return get_commit_tree_in_graph(commit);
+       return get_commit_tree_in_graph(the_repository, commit);
 }
 
 struct object_id *get_commit_tree_oid(const struct commit *commit)
@@ -438,7 +438,7 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
        item->date = parse_commit_date(bufptr, tail);
 
        if (check_graph)
-               load_commit_graph_info(item);
+               load_commit_graph_info(the_repository, item);
 
        return 0;
 }
@@ -454,7 +454,7 @@ int parse_commit_internal(struct commit *item, int quiet_on_missing, int use_com
                return -1;
        if (item->object.parsed)
                return 0;
-       if (use_commit_graph && parse_commit_in_graph(item))
+       if (use_commit_graph && parse_commit_in_graph(the_repository, item))
                return 0;
        buffer = read_object_file(&item->object.oid, &type, &size);
        if (!buffer)
@@ -656,7 +656,7 @@ struct commit *pop_commit(struct commit_list **stack)
 define_commit_slab(indegree_slab, int);
 
 /* record author-date for each commit object */
-define_commit_slab(author_date_slab, unsigned long);
+define_commit_slab(author_date_slab, timestamp_t);
 
 static void record_author_date(struct author_date_slab *author_date,
                               struct commit *commit)
@@ -874,6 +874,9 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n,
        int i;
        uint32_t last_gen = GENERATION_NUMBER_INFINITY;
 
+       if (!min_generation)
+               queue.compare = compare_commits_by_commit_date;
+
        one->object.flags |= PARENT1;
        if (!n) {
                commit_list_append(one, &result);
@@ -891,7 +894,7 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n,
                struct commit_list *parents;
                int flags;
 
-               if (commit->generation > last_gen)
+               if (min_generation && commit->generation > last_gen)
                        BUG("bad generation skip %8x > %8x at %s",
                            commit->generation, last_gen,
                            oid_to_hex(&commit->object.oid));