diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-02-18 04:21:42 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-18 04:21:42 +0300 |
commit | 726b11d68a5e9092a668fd42acb3e25394f92995 (patch) | |
tree | 3d52ea9498502e364f2735293a1fcfd415d3a19b /commit-graph.c | |
parent | e9b4c483c7052c1b422edb3569ff198fb2bfff46 (diff) | |
parent | c85eec7fc37e1ca79072f263ae6ea1ee305ba38c (diff) |
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
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/commit-graph.c b/commit-graph.c index f70886c2d3..ed31843fa5 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -215,16 +215,24 @@ static int commit_graph_compatible(struct repository *r) if (read_replace_refs) { prepare_replace_object(r); - if (hashmap_get_size(&r->objects->replace_map->map)) + if (hashmap_get_size(&r->objects->replace_map->map)) { + warning(_("repository contains replace objects; " + "skipping commit-graph")); return 0; + } } prepare_commit_graft(r); if (r->parsed_objects && - (r->parsed_objects->grafts_nr || r->parsed_objects->substituted_parent)) + (r->parsed_objects->grafts_nr || r->parsed_objects->substituted_parent)) { + warning(_("repository contains (deprecated) grafts; " + "skipping commit-graph")); return 0; - if (is_repository_shallow(r)) + } + if (is_repository_shallow(r)) { + warning(_("repository is shallow; skipping commit-graph")); return 0; + } return 1; } |