diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-05-06 22:10:13 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-08 15:12:57 +0900 |
commit | 3e9309815da9aab4e13195b7c6a52c1f7161562a (patch) | |
tree | ace618adc7f4470a15c3a4980d320137cc467ded /object.c | |
parent | builtin/unpack-objects: convert to struct object_id (diff) | |
download | tgif-3e9309815da9aab4e13195b7c6a52c1f7161562a.tar.xz |
Convert remaining callers of lookup_blob to object_id
All but a few callers of lookup_blob have been converted to struct
object_id. Introduce a temporary, which will be removed later, into
parse_object to ease the transition, and convert the remaining callers
so that we can update lookup_blob to take struct object_id *.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r-- | object.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -190,7 +190,7 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t obj = NULL; if (type == OBJ_BLOB) { - struct blob *blob = lookup_blob(sha1); + struct blob *blob = lookup_blob(oid.hash); if (blob) { if (parse_blob_buffer(blob, buffer, size)) return NULL; @@ -251,8 +251,11 @@ struct object *parse_object(const unsigned char *sha1) const unsigned char *repl = lookup_replace_object(sha1); void *buffer; struct object *obj; + struct object_id oid; + + hashcpy(oid.hash, sha1); - obj = lookup_object(sha1); + obj = lookup_object(oid.hash); if (obj && obj->parsed) return obj; @@ -263,7 +266,7 @@ struct object *parse_object(const unsigned char *sha1) error("sha1 mismatch %s", sha1_to_hex(repl)); return NULL; } - parse_blob_buffer(lookup_blob(sha1), NULL, 0); + parse_blob_buffer(lookup_blob(oid.hash), NULL, 0); return lookup_object(sha1); } |