summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Derrick Stolee <dstolee@microsoft.com>2020-10-12 13:28:34 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-10-12 12:13:21 -0700
commitd334107c5da27e5212e21e77da03e938ea6db976 (patch)
tree8774649784216bb94515ff81d7eaa232ee28a224 /builtin
parentmaintenance: test commit-graph auto condition (diff)
downloadtgif-d334107c5da27e5212e21e77da03e938ea6db976.tar.xz
maintenance: core.commitGraph=false prevents writes
Recently, a user had an issue due to combining fetch.writeCommitGraph=true with core.commitGraph=false. The root bug has been resolved by preventing commit-graph writes when core.commitGraph is disabled. This happens inside the 'git commit-graph write' command, but we can be more aware of this situation and prevent that process from ever starting in the 'commit-graph' maintenance task. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/gc.c b/builtin/gc.c
index 12ddb68bba..e80331c4e2 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -813,6 +813,10 @@ static int run_write_commit_graph(struct maintenance_run_opts *opts)
static int maintenance_task_commit_graph(struct maintenance_run_opts *opts)
{
+ prepare_repo_settings(the_repository);
+ if (!the_repository->settings.core_commit_graph)
+ return 0;
+
close_object_store(the_repository->objects);
if (run_write_commit_graph(opts)) {
error(_("failed to write commit-graph"));