mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
Merge branch 'ds/lazy-load-trees'
The code has been taught to use the duplicated information stored in the commit-graph file to learn the tree object name for a commit to avoid opening and parsing the commit object when it makes sense to do so. * ds/lazy-load-trees: coccinelle: avoid wrong transformation suggestions from commit.cocci commit-graph: lazy-load trees for commits treewide: replace maybe_tree with accessor methods commit: create get_commit_tree() method treewide: rename tree to maybe_tree
This commit is contained in:
4
tree.c
4
tree.c
@@ -109,7 +109,7 @@ static int read_tree_1(struct tree *tree, struct strbuf *base,
|
||||
oid_to_hex(entry.oid),
|
||||
base->buf, entry.path);
|
||||
|
||||
oidcpy(&oid, &commit->tree->object.oid);
|
||||
oidcpy(&oid, get_commit_tree_oid(commit));
|
||||
}
|
||||
else
|
||||
continue;
|
||||
@@ -248,7 +248,7 @@ struct tree *parse_tree_indirect(const struct object_id *oid)
|
||||
if (obj->type == OBJ_TREE)
|
||||
return (struct tree *) obj;
|
||||
else if (obj->type == OBJ_COMMIT)
|
||||
obj = &(((struct commit *) obj)->tree->object);
|
||||
obj = &(get_commit_tree(((struct commit *)obj))->object);
|
||||
else if (obj->type == OBJ_TAG)
|
||||
obj = ((struct tag *) obj)->tagged;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user