Skip to content

Commit 286d258

Browse files
stefanbellergitster
authored andcommitted
tag.c: allow deref_tag to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8e4b0b6 commit 286d258

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tag.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,11 @@ int gpg_verify_tag(const struct object_id *oid, const char *name_to_report,
6464
return ret;
6565
}
6666

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)
6868
{
6969
while (o && o->type == OBJ_TAG)
7070
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);
7372
else
7473
o = NULL;
7574
if (!o && warn) {

tag.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ extern struct tag *lookup_tag(struct repository *r, const struct object_id *oid)
1515
extern int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size);
1616
extern int parse_tag(struct tag *item);
1717
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);
2019
extern struct object *deref_tag_noverify(struct object *);
2120
extern int gpg_verify_tag(const struct object_id *oid,
2221
const char *name_to_report, unsigned flags);

0 commit comments

Comments
 (0)