aboutsummaryrefslogtreecommitdiff
path: root/ref-filter.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-05-06 22:10:21 +0000
committerJunio C Hamano <gitster@pobox.com>2017-05-08 15:12:57 +0900
commitcedfc41ac62c691557263a8db41f7f693914d68d (patch)
tree4120173090660b6bdc3a2c91a0461ada84b6b9ea /ref-filter.c
parent9fd750461befcaf984d5966606308c8cd6912f3c (diff)
downloadgit-cedfc41ac62c691557263a8db41f7f693914d68d.tar.gz
git-cedfc41ac62c691557263a8db41f7f693914d68d.tar.xz
Convert struct ref_array_item to struct object_id
Convert struct ref_array_item to use struct object_id by changing the definition and applying the following semantic patch, plus the standard object_id transforms: @@ struct ref_array_item E1; @@ - E1.objectname + E1.objectname.hash @@ struct ref_array_item *E1; @@ - E1->objectname + E1->objectname.hash This transformation allows us to convert get_obj, which is needed to convert parse_object_buffer. 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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ref-filter.c b/ref-filter.c
index e1d18ac0d..77aee273f 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -1366,7 +1366,7 @@ static void populate_value(struct ref_array_item *ref)
v->s = xstrdup(buf + 1);
}
continue;
- } else if (!deref && grab_objectname(name, ref->objectname, v, atom)) {
+ } else if (!deref && grab_objectname(name, ref->objectname.hash, v, atom)) {
continue;
} else if (!strcmp(name, "HEAD")) {
const char *head;
@@ -1415,13 +1415,13 @@ static void populate_value(struct ref_array_item *ref)
return;
need_obj:
- buf = get_obj(ref->objectname, &obj, &size, &eaten);
+ buf = get_obj(ref->objectname.hash, &obj, &size, &eaten);
if (!buf)
die(_("missing object %s for %s"),
- sha1_to_hex(ref->objectname), ref->refname);
+ oid_to_hex(&ref->objectname), ref->refname);
if (!obj)
die(_("parse_object_buffer failed on %s for %s"),
- sha1_to_hex(ref->objectname), ref->refname);
+ oid_to_hex(&ref->objectname), ref->refname);
grab_values(ref->value, 0, obj, buf, size);
if (!eaten)
@@ -1704,7 +1704,7 @@ static struct ref_array_item *new_ref_array_item(const char *refname,
{
struct ref_array_item *ref;
FLEX_ALLOC_STR(ref, refname, refname);
- hashcpy(ref->objectname, objectname);
+ hashcpy(ref->objectname.hash, objectname);
ref->flag = flag;
return ref;