Skip to content

Commit 726b11d

Browse files
committed
Merge branch 'js/commit-graph-warning'
When certain features (e.g. grafts) used in the repository are incompatible with the use of the commit-graph, we used to silently turned commit-graph off; we now tell the user what we are doing. * js/commit-graph-warning: commit-graph: when incompatible with graphs, indicate why
2 parents e9b4c48 + c85eec7 commit 726b11d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

commit-graph.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,24 @@ static int commit_graph_compatible(struct repository *r)
215215

216216
if (read_replace_refs) {
217217
prepare_replace_object(r);
218-
if (hashmap_get_size(&r->objects->replace_map->map))
218+
if (hashmap_get_size(&r->objects->replace_map->map)) {
219+
warning(_("repository contains replace objects; "
220+
"skipping commit-graph"));
219221
return 0;
222+
}
220223
}
221224

222225
prepare_commit_graft(r);
223226
if (r->parsed_objects &&
224-
(r->parsed_objects->grafts_nr || r->parsed_objects->substituted_parent))
227+
(r->parsed_objects->grafts_nr || r->parsed_objects->substituted_parent)) {
228+
warning(_("repository contains (deprecated) grafts; "
229+
"skipping commit-graph"));
225230
return 0;
226-
if (is_repository_shallow(r))
231+
}
232+
if (is_repository_shallow(r)) {
233+
warning(_("repository is shallow; skipping commit-graph"));
227234
return 0;
235+
}
228236

229237
return 1;
230238
}

0 commit comments

Comments
 (0)