sha1_file: convert sha1_object_info* to object_id
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2; @@ - sha1_object_info(E1.hash, E2) + oid_object_info(&E1, E2) @@ expression E1, E2; @@ - sha1_object_info(E1->hash, E2) + oid_object_info(E1, E2) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1.hash, E2, E3) + oid_object_info_extended(&E1, E2, E3) @@ expression E1, E2, E3; @@ - sha1_object_info_extended(E1->hash, E2, E3) + oid_object_info_extended(E1, E2, E3) Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
7984f23833
commit
abef9020e3
2
refs.c
2
refs.c
@ -301,7 +301,7 @@ enum peel_status peel_object(const struct object_id *name, struct object_id *oid
|
||||
struct object *o = lookup_unknown_object(name->hash);
|
||||
|
||||
if (o->type == OBJ_NONE) {
|
||||
int type = sha1_object_info(name->hash, NULL);
|
||||
int type = oid_object_info(name, NULL);
|
||||
if (type < 0 || !object_as_type(o, type, 0))
|
||||
return PEEL_INVALID;
|
||||
}
|
||||
|
Reference in New Issue
Block a user