diff --git a/commit-graph.c b/commit-graph.c index 45bbea4644..be2b2683c1 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -2389,12 +2389,6 @@ int write_commit_graph(struct object_directory *odb, } if (!commit_graph_compatible(r)) return 0; - if (r->settings.commit_graph_changed_paths_version < -1 - || r->settings.commit_graph_changed_paths_version > 2) { - warning(_("attempting to write a commit-graph, but 'commitgraph.changedPathsVersion' (%d) is not supported"), - r->settings.commit_graph_changed_paths_version); - return 0; - } CALLOC_ARRAY(ctx, 1); ctx->r = r; @@ -2407,6 +2401,12 @@ int write_commit_graph(struct object_directory *odb, ctx->write_generation_data = (get_configured_generation_version(r) == 2); ctx->num_generation_data_overflows = 0; + if (r->settings.commit_graph_changed_paths_version < -1 + || r->settings.commit_graph_changed_paths_version > 2) { + warning(_("attempting to write a commit-graph, but 'commitgraph.changedPathsVersion' (%d) is not supported"), + r->settings.commit_graph_changed_paths_version); + return 0; + } bloom_settings.hash_version = r->settings.commit_graph_changed_paths_version == 2 ? 2 : 1; bloom_settings.bits_per_entry = git_env_ulong("GIT_TEST_BLOOM_SETTINGS_BITS_PER_ENTRY",