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:
5
object.c
5
object.c
@ -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 {
|
||||
|
Reference in New Issue
Block a user