Skip to content

Commit da0f0ed

Browse files
To1negitster
authored andcommitted
commit-graph: export prepare_commit_graph()
Allow users of the commit-graph to explicitly prepare the commit-graph. This can be useful when users want to start using bloom keys before calling functions like prepare_revision_walk(). We'll use this exported function in a subsequent commit. Signed-off-by: Toon Claes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cc414ca commit da0f0ed

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

commit-graph.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -739,13 +739,7 @@ static void prepare_commit_graph_one(struct repository *r,
739739
r->objects->commit_graph = read_commit_graph_one(r, source);
740740
}
741741

742-
/*
743-
* Return 1 if commit_graph is non-NULL, and 0 otherwise.
744-
*
745-
* On the first invocation, this function attempts to load the commit
746-
* graph if the_repository is configured to have one.
747-
*/
748-
static int prepare_commit_graph(struct repository *r)
742+
int prepare_commit_graph(struct repository *r)
749743
{
750744
struct odb_source *source;
751745

commit-graph.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ struct repo_settings;
131131
struct commit_graph *parse_commit_graph(struct repo_settings *s,
132132
void *graph_map, size_t graph_size);
133133

134+
/*
135+
* Return 1 if commit_graph is non-NULL, and 0 otherwise.
136+
*
137+
* On the first invocation, this function attempts to load the commit
138+
* graph if the_repository is configured to have one.
139+
*/
140+
int prepare_commit_graph(struct repository *r);
141+
134142
/*
135143
* Return 1 if and only if the repository has a commit-graph
136144
* file and generation numbers are computed in that file.

0 commit comments

Comments
 (0)