From c3756d5b7fc6e163032296aa6c10fad2589273dc Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Wed, 11 Jul 2018 15:42:40 -0700 Subject: commit-graph: add free_commit_graph Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- builtin/commit-graph.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin') diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index c7d0db5ab4..0bf0c48657 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -115,6 +115,8 @@ static int graph_read(int argc, const char **argv) printf(" large_edges"); printf("\n"); + free_commit_graph(graph); + return 0; } -- cgit v1.2.1 From dade47c06cf849b0ca180a8e6383b55ea6f75812 Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Wed, 11 Jul 2018 15:42:42 -0700 Subject: 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 Signed-off-by: Junio C Hamano --- builtin/fsck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') diff --git a/builtin/fsck.c b/builtin/fsck.c index ea5e2a03e6..c96f3f4fcc 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -830,7 +830,7 @@ int cmd_fsck(int argc, const char **argv, const char *prefix) check_connectivity(); - if (core_commit_graph) { + if (!git_config_get_bool("core.commitgraph", &i) && i) { struct child_process commit_graph_verify = CHILD_PROCESS_INIT; const char *verify_argv[] = { "commit-graph", "verify", NULL, NULL, NULL }; -- cgit v1.2.1