diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2018-07-12 00:42:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-18 00:47:48 +0200 |
commit | dade47c06cf849b0ca180a8e6383b55ea6f75812 (patch) | |
tree | 9e7884a642dbf92f13b874457bf21464c383b9b2 /commit-graph.h | |
parent | commit-graph: store graph in struct object_store (diff) | |
download | git-dade47c06cf849b0ca180a8e6383b55ea6f75812.tar.xz git-dade47c06cf849b0ca180a8e6383b55ea6f75812.zip |
commit-graph: add repo arg to graph readers
Add a struct repository argument to the functions in commit-graph.h that
read the commit graph. (This commit does not affect functions that write
commit graphs.)
Because the commit graph functions can now read the commit graph of any
repository, the global variable core_commit_graph has been removed.
Instead, the config option core.commitGraph is now read on the first
time in a repository that a commit is attempted to be parsed using its
commit graph.
This commit includes a test that exercises the functionality on an
arbitrary repository that is not the_repository.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
-rw-r--r-- | commit-graph.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/commit-graph.h b/commit-graph.h index 94defb04a9..76e098934a 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -19,7 +19,7 @@ char *get_commit_graph_filename(const char *obj_dir); * * See parse_commit_buffer() for the fallback after this call. */ -int parse_commit_in_graph(struct commit *item); +int parse_commit_in_graph(struct repository *r, struct commit *item); /* * It is possible that we loaded commit contents from the commit buffer, @@ -27,9 +27,10 @@ int parse_commit_in_graph(struct commit *item); * checked and filled. Fill the graph_pos and generation members of * the given commit. */ -void load_commit_graph_info(struct commit *item); +void load_commit_graph_info(struct repository *r, struct commit *item); -struct tree *get_commit_tree_in_graph(const struct commit *c); +struct tree *get_commit_tree_in_graph(struct repository *r, + const struct commit *c); struct commit_graph { int graph_fd; |