diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2015-11-10 02:22:27 +0000 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-11-20 08:02:05 -0500 |
commit | 7999b2cf772956466baa8925491d6fb1b0963292 (patch) | |
tree | 34a3bf75c3cdc621d732107f53181ff28c0550a4 /ref-filter.c | |
parent | object: introduce get_object_hash macro. (diff) | |
download | tgif-7999b2cf772956466baa8925491d6fb1b0963292.tar.xz |
Add several uses of get_object_hash.
Convert most instances where the sha1 member of struct object is
dereferenced to use get_object_hash. Most instances that are passed to
functions that have versions taking struct object_id, such as
get_sha1_hex/get_oid_hex, or instances that can be trivially converted
to use struct object_id instead, are not converted.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'ref-filter.c')
-rw-r--r-- | ref-filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ref-filter.c b/ref-filter.c index e205dd2f68..25a82a46be 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -372,7 +372,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct object v->s = xstrfmt("%lu", sz); } else if (deref) - grab_objectname(name, obj->sha1, v); + grab_objectname(name, get_object_hash(*obj), v); } } @@ -992,7 +992,7 @@ static void populate_value(struct ref_array_item *ref) * If it is a tag object, see if we use a value that derefs * the object, and if we do grab the object it refers to. */ - tagged = ((struct tag *)obj)->tagged->sha1; + tagged = get_object_hash(*((struct tag *)obj)->tagged); /* * NEEDSWORK: This derefs tag only once, which @@ -1218,7 +1218,7 @@ static const unsigned char *match_points_at(struct sha1_array *points_at, if (!obj) die(_("malformed object at '%s'"), refname); if (obj->type == OBJ_TAG) - tagged_sha1 = ((struct tag *)obj)->tagged->sha1; + tagged_sha1 = get_object_hash(*((struct tag *)obj)->tagged); if (tagged_sha1 && sha1_array_lookup(points_at, tagged_sha1) >= 0) return tagged_sha1; return NULL; |