diff options
Diffstat (limited to 'tag.c')
-rw-r--r-- | tag.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -64,11 +64,11 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report, return ret; } -struct object *deref_tag(struct object *o, const char *warn, int warnlen) +struct object *deref_tag(struct repository *r, struct object *o, const char *warn, int warnlen) { while (o && o->type == OBJ_TAG) if (((struct tag *)o)->tagged) - o = parse_object(&((struct tag *)o)->tagged->oid); + o = parse_object(r, &((struct tag *)o)->tagged->oid); else o = NULL; if (!o && warn) { @@ -82,7 +82,7 @@ struct object *deref_tag(struct object *o, const char *warn, int warnlen) struct object *deref_tag_noverify(struct object *o) { while (o && o->type == OBJ_TAG) { - o = parse_object(&o->oid); + o = parse_object(the_repository, &o->oid); if (o && o->type == OBJ_TAG && ((struct tag *)o)->tagged) o = ((struct tag *)o)->tagged; else @@ -91,13 +91,13 @@ struct object *deref_tag_noverify(struct object *o) return o; } -struct tag *lookup_tag(const struct object_id *oid) +struct tag *lookup_tag(struct repository *r, const struct object_id *oid) { - struct object *obj = lookup_object(oid->hash); + struct object *obj = lookup_object(r, oid->hash); if (!obj) - return create_object(the_repository, oid->hash, - alloc_tag_node(the_repository)); - return object_as_type(obj, OBJ_TAG, 0); + return create_object(r, oid->hash, + alloc_tag_node(r)); + return object_as_type(r, obj, OBJ_TAG, 0); } static timestamp_t parse_tag_date(const char *buf, const char *tail) @@ -125,7 +125,7 @@ void release_tag_memory(struct tag *t) t->date = 0; } -int parse_tag_buffer(struct tag *item, const void *data, unsigned long size) +int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size) { struct object_id oid; char type[20]; @@ -153,13 +153,13 @@ int parse_tag_buffer(struct tag *item, const void *data, unsigned long size) bufptr = nl + 1; if (!strcmp(type, blob_type)) { - item->tagged = (struct object *)lookup_blob(&oid); + item->tagged = (struct object *)lookup_blob(r, &oid); } else if (!strcmp(type, tree_type)) { - item->tagged = (struct object *)lookup_tree(&oid); + item->tagged = (struct object *)lookup_tree(r, &oid); } else if (!strcmp(type, commit_type)) { - item->tagged = (struct object *)lookup_commit(&oid); + item->tagged = (struct object *)lookup_commit(r, &oid); } else if (!strcmp(type, tag_type)) { - item->tagged = (struct object *)lookup_tag(&oid); + item->tagged = (struct object *)lookup_tag(r, &oid); } else { error("Unknown type %s", type); item->tagged = NULL; @@ -202,7 +202,7 @@ int parse_tag(struct tag *item) return error("Object %s not a tag", oid_to_hex(&item->object.oid)); } - ret = parse_tag_buffer(item, data, size); + ret = parse_tag_buffer(the_repository, item, data, size); free(data); return ret; } |