aboutsummaryrefslogtreecommitdiffstats
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-08 16:22:05 -0800
committerJunio C Hamano <gitster@pobox.com>2024-02-08 16:22:05 -0800
commit1685e9ffe664e834c3d2d7a28144f3e52c0add4f (patch)
tree17459c3bef83e1d390ff094ff2e486acf97a34cc /commit-graph.c
parentMerge branch 'cp/git-flush-is-an-env-bool' into maint-2.43 (diff)
parentcommit-graph: retain commit slab when closing NULL commit_graph (diff)
downloadgit-1685e9ffe664e834c3d2d7a28144f3e52c0add4f.tar.gz
git-1685e9ffe664e834c3d2d7a28144f3e52c0add4f.zip
Merge branch 'jk/commit-graph-slab-clear-fix' into maint-2.43
Clearing in-core repository (happens during e.g., "git fetch --recurse-submodules" with commit graph enabled) made in-core commit object in an inconsistent state by discarding the necessary data from commit-graph too early, which has been corrected. * jk/commit-graph-slab-clear-fix: commit-graph: retain commit slab when closing NULL commit_graph
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/commit-graph.c b/commit-graph.c
index a712917356..f2def8bb49 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -831,6 +831,9 @@ struct bloom_filter_settings *get_bloom_filter_settings(struct repository *r)
void close_commit_graph(struct raw_object_store *o)
{
+ if (!o->commit_graph)
+ return;
+
clear_commit_graph_data_slab(&commit_graph_data_slab);
free_commit_graph(o->commit_graph);
o->commit_graph = NULL;