Convert lookup_tree to struct object_id
Convert the lookup_tree function to take a pointer to struct object_id. The commit was created with manual changes to tree.c, tree.h, and object.c, plus the following semantic patch: @@ @@ - lookup_tree(EMPTY_TREE_SHA1_BIN) + lookup_tree(&empty_tree_oid) @@ expression E1; @@ - lookup_tree(E1.hash) + lookup_tree(&E1) @@ expression E1; @@ - lookup_tree(E1->hash) + lookup_tree(E1) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
49a09e74a4
commit
740ee055c6
2
commit.c
2
commit.c
@ -331,7 +331,7 @@ int parse_commit_buffer(struct commit *item, const void *buffer, unsigned long s
|
||||
if (get_sha1_hex(bufptr + 5, parent.hash) < 0)
|
||||
return error("bad tree pointer in commit %s",
|
||||
oid_to_hex(&item->object.oid));
|
||||
item->tree = lookup_tree(parent.hash);
|
||||
item->tree = lookup_tree(&parent);
|
||||
bufptr += tree_entry_len + 1; /* "tree " + "hex sha1" + "\n" */
|
||||
pptr = &item->parents;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user