Convert lookup_blob to struct object_id

Convert lookup_blob to take a pointer to struct object_id.

The commit was created with manual changes to blob.c and blob.h, plus
the following semantic patch:

@@
expression E1;
@@
- lookup_blob(E1.hash)
+ lookup_blob(&E1)

@@
expression E1;
@@
- lookup_blob(E1->hash)
+ lookup_blob(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:14 +00:00
committed by Junio C Hamano
parent 3e9309815d
commit 3aca1fc6c9
15 changed files with 19 additions and 19 deletions

6
blob.c
View File

@ -3,11 +3,11 @@
const char *blob_type = "blob";
struct blob *lookup_blob(const unsigned char *sha1)
struct blob *lookup_blob(const struct object_id *oid)
{
struct object *obj = lookup_object(sha1);
struct object *obj = lookup_object(oid->hash);
if (!obj)
return create_object(sha1, alloc_blob_node());
return create_object(oid->hash, alloc_blob_node());
return object_as_type(obj, OBJ_BLOB, 0);
}