diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-31 04:39:57 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-31 18:33:55 +0300 |
commit | 4ce3621a6dd3f98dab3c588b7f53f81b8404df32 (patch) | |
tree | 9f446e67e0e1de4b8b89c54eb8bf851a691d1128 /ref-filter.c | |
parent | 98a72ddc12e13231537150607f4a6a8ff8b43854 (diff) |
Convert remaining callers of sha1_array_lookup to object_id
There are a very small number of callers which don't already use struct
object_id. Convert them.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/ref-filter.c b/ref-filter.c index 9c82b5b9d6..d3dcb53dd5 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1677,22 +1677,22 @@ static int filter_pattern_match(struct ref_filter *filter, const char *refname) * the need to parse the object via parse_object(). peel_ref() might be a * more efficient alternative to obtain the pointee. */ -static const unsigned char *match_points_at(struct sha1_array *points_at, - const unsigned char *sha1, - const char *refname) +static const struct object_id *match_points_at(struct sha1_array *points_at, + const struct object_id *oid, + const char *refname) { - const unsigned char *tagged_sha1 = NULL; + const struct object_id *tagged_oid = NULL; struct object *obj; - if (sha1_array_lookup(points_at, sha1) >= 0) - return sha1; - obj = parse_object(sha1); + if (sha1_array_lookup(points_at, oid->hash) >= 0) + return oid; + obj = parse_object(oid->hash); if (!obj) die(_("malformed object at '%s'"), refname); if (obj->type == OBJ_TAG) - tagged_sha1 = ((struct tag *)obj)->tagged->oid.hash; - if (tagged_sha1 && sha1_array_lookup(points_at, tagged_sha1) >= 0) - return tagged_sha1; + tagged_oid = &((struct tag *)obj)->tagged->oid; + if (tagged_oid && sha1_array_lookup(points_at, tagged_oid->hash) >= 0) + return tagged_oid; return NULL; } @@ -1772,7 +1772,7 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid, if (!filter_pattern_match(filter, refname)) return 0; - if (filter->points_at.nr && !match_points_at(&filter->points_at, oid->hash, refname)) + if (filter->points_at.nr && !match_points_at(&filter->points_at, oid, refname)) return 0; /* |