Skip to content

Commit 8bde69b

Browse files
stefanbellergitster
authored andcommitted
tag: allow lookup_tag to handle arbitrary repositories
Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bacf168 commit 8bde69b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tag.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ struct object *deref_tag_noverify(struct object *o)
9292
return o;
9393
}
9494

95-
struct tag *lookup_tag_the_repository(const struct object_id *oid)
95+
struct tag *lookup_tag(struct repository *r, const struct object_id *oid)
9696
{
97-
struct object *obj = lookup_object(the_repository, oid->hash);
97+
struct object *obj = lookup_object(r, oid->hash);
9898
if (!obj)
99-
return create_object(the_repository, oid->hash,
100-
alloc_tag_node(the_repository));
101-
return object_as_type(the_repository, obj, OBJ_TAG, 0);
99+
return create_object(r, oid->hash,
100+
alloc_tag_node(r));
101+
return object_as_type(r, obj, OBJ_TAG, 0);
102102
}
103103

104104
static timestamp_t parse_tag_date(const char *buf, const char *tail)

tag.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ struct tag {
1111
char *tag;
1212
timestamp_t date;
1313
};
14-
#define lookup_tag(r, o) lookup_tag_##r(o)
15-
extern struct tag *lookup_tag_the_repository(const struct object_id *oid);
14+
extern struct tag *lookup_tag(struct repository *r, const struct object_id *oid);
1615
#define parse_tag_buffer(r, i, d, s) parse_tag_buffer_##r(i, d, s)
1716
extern int parse_tag_buffer_the_repository(struct tag *item, const void *data, unsigned long size);
1817
extern int parse_tag(struct tag *item);

0 commit comments

Comments
 (0)