tag.c: allow deref_tag to handle arbitrary repositories

Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Stefan Beller committed Jun 28, 2018 at 18:22 UTC 286d258d4f8b6f67676b1c50c2fd07a577450518
2 files changed +3 -5
tag.c
+2 -3
@@ -64,12 +64,11 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
64 return ret;
65 }
66
67 -struct object *deref_tag_the_repository(struct object *o, const char *warn, int warnlen)
67 +struct object *deref_tag(struct repository *r, struct object *o, const char *warn, int warnlen)
68 {
69 while (o && o->type == OBJ_TAG)
70 if (((struct tag *)o)->tagged)
71 - o = parse_object(the_repository,
72 - &((struct tag *)o)->tagged->oid);
71 + o = parse_object(r, &((struct tag *)o)->tagged->oid);
72 else
73 o = NULL;
74 if (!o && warn) {
tag.h
+1 -2
@@ -15,8 +15,7 @@ extern struct tag *lookup_tag(struct repository *r, const struct object_id *oid)
15 extern int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size);
16 extern int parse_tag(struct tag *item);
17 extern void release_tag_memory(struct tag *t);
18 -#define deref_tag(r, o, w, l) deref_tag_##r(o, w, l)
19 -extern struct object *deref_tag_the_repository(struct object *, const char *, int);
18 +extern struct object *deref_tag(struct repository *r, struct object *, const char *, int);
19 extern struct object *deref_tag_noverify(struct object *);
20 extern int gpg_verify_tag(const struct object_id *oid,
21 const char *name_to_report, unsigned flags);