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:
brian m. carlson
2017-05-06 22:10:17 +00:00
committed by Junio C Hamano
parent 49a09e74a4
commit 740ee055c6
18 changed files with 25 additions and 25 deletions

2
tag.c
View File

@ -144,7 +144,7 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)
if (!strcmp(type, blob_type)) {
item->tagged = &lookup_blob(&oid)->object;
} else if (!strcmp(type, tree_type)) {
item->tagged = &lookup_tree(oid.hash)->object;
item->tagged = &lookup_tree(&oid)->object;
} else if (!strcmp(type, commit_type)) {
item->tagged = &lookup_commit(&oid)->object;
} else if (!strcmp(type, tag_type)) {