Convert sha1_array_lookup to take struct object_id
Convert this function by changing the declaration and definition and applying the following semantic patch to update the callers: @@ expression E1, E2; @@ - sha1_array_lookup(E1, E2.hash) + sha1_array_lookup(E1, &E2) @@ expression E1, E2; @@ - sha1_array_lookup(E1, E2->hash) + sha1_array_lookup(E1, E2) 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
4ce3621a6d
commit
5d3206d501
@ -1684,14 +1684,14 @@ static const struct object_id *match_points_at(struct sha1_array *points_at,
|
||||
const struct object_id *tagged_oid = NULL;
|
||||
struct object *obj;
|
||||
|
||||
if (sha1_array_lookup(points_at, oid->hash) >= 0)
|
||||
if (sha1_array_lookup(points_at, oid) >= 0)
|
||||
return oid;
|
||||
obj = parse_object(oid->hash);
|
||||
if (!obj)
|
||||
die(_("malformed object at '%s'"), refname);
|
||||
if (obj->type == OBJ_TAG)
|
||||
tagged_oid = &((struct tag *)obj)->tagged->oid;
|
||||
if (tagged_oid && sha1_array_lookup(points_at, tagged_oid->hash) >= 0)
|
||||
if (tagged_oid && sha1_array_lookup(points_at, tagged_oid) >= 0)
|
||||
return tagged_oid;
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user