summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2018-07-11 22:42:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-17 22:47:48 (GMT)
commitdade47c06cf849b0ca180a8e6383b55ea6f75812 (patch)
tree9e7884a642dbf92f13b874457bf21464c383b9b2 /builtin/fsck.c
parent8527750626f8a1b0fe641a5163760be054cc1d64 (diff)
downloadgit-dade47c06cf849b0ca180a8e6383b55ea6f75812.zip
git-dade47c06cf849b0ca180a8e6383b55ea6f75812.tar.gz
git-dade47c06cf849b0ca180a8e6383b55ea6f75812.tar.bz2
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 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index ea5e2a0..c96f3f4 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 };