Merge branch 'tb/fix-persistent-shallow' into master

When "fetch.writeCommitGraph" configuration is set in a shallow
repository and a fetch moves the shallow boundary, we wrote out
broken commit-graph files that do not match the reality, which has
been corrected.

* tb/fix-persistent-shallow:
  commit.c: don't persist substituted parents when unshallowing
This commit is contained in:
Junio C Hamano
2020-07-09 14:00:44 -07:00
4 changed files with 19 additions and 1 deletions

View File

@ -203,7 +203,8 @@ static int commit_graph_compatible(struct repository *r)
}
prepare_commit_graft(r);
if (r->parsed_objects && r->parsed_objects->grafts_nr)
if (r->parsed_objects &&
(r->parsed_objects->grafts_nr || r->parsed_objects->substituted_parent))
return 0;
if (is_repository_shallow(r))
return 0;