Skip to content

Commit 84f80cd

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

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
@@ -126,7 +126,7 @@ void release_tag_memory(struct tag *t)
126126
t->date = 0;
127127
}
128128

129-
int parse_tag_buffer_the_repository(struct tag *item, const void *data, unsigned long size)
129+
int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size)
130130
{
131131
struct object_id oid;
132132
char type[20];
@@ -154,13 +154,13 @@ int parse_tag_buffer_the_repository(struct tag *item, const void *data, unsigned
154154
bufptr = nl + 1;
155155

156156
if (!strcmp(type, blob_type)) {
157-
item->tagged = (struct object *)lookup_blob(the_repository, &oid);
157+
item->tagged = (struct object *)lookup_blob(r, &oid);
158158
} else if (!strcmp(type, tree_type)) {
159-
item->tagged = (struct object *)lookup_tree(the_repository, &oid);
159+
item->tagged = (struct object *)lookup_tree(r, &oid);
160160
} else if (!strcmp(type, commit_type)) {
161-
item->tagged = (struct object *)lookup_commit(the_repository, &oid);
161+
item->tagged = (struct object *)lookup_commit(r, &oid);
162162
} else if (!strcmp(type, tag_type)) {
163-
item->tagged = (struct object *)lookup_tag(the_repository, &oid);
163+
item->tagged = (struct object *)lookup_tag(r, &oid);
164164
} else {
165165
error("Unknown type %s", type);
166166
item->tagged = NULL;

tag.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ struct tag {
1212
timestamp_t date;
1313
};
1414
extern struct tag *lookup_tag(struct repository *r, const struct object_id *oid);
15-
#define parse_tag_buffer(r, i, d, s) parse_tag_buffer_##r(i, d, s)
16-
extern int parse_tag_buffer_the_repository(struct tag *item, const void *data, unsigned long size);
15+
extern int parse_tag_buffer(struct repository *r, struct tag *item, const void *data, unsigned long size);
1716
extern int parse_tag(struct tag *item);
1817
extern void release_tag_memory(struct tag *t);
1918
#define deref_tag(r, o, w, l) deref_tag_##r(o, w, l)

0 commit comments

Comments
 (0)