Merge branch 'sg/object-as-type-commit-graph-fix'

The commit-graph facility did not work when in-core objects that
are promoted from unknown type to commit (e.g. a commit that is
accessed via a tag that refers to it) were involved, which has been
corrected.

* sg/object-as-type-commit-graph-fix:
  object_as_type: initialize commit-graph-related fields of 'struct commit'
This commit is contained in:
Junio C Hamano
2019-02-05 14:26:19 -08:00
3 changed files with 14 additions and 8 deletions

View File

@ -164,8 +164,9 @@ void *object_as_type(struct repository *r, struct object *obj, enum object_type
return obj;
else if (obj->type == OBJ_NONE) {
if (type == OBJ_COMMIT)
((struct commit *)obj)->index = alloc_commit_index(r);
obj->type = type;
init_commit_node(r, (struct commit *) obj);
else
obj->type = type;
return obj;
}
else {