Skip to content

Commit 628d81b

Browse files
pks-tgitster
authored andcommitted
list-objects: move tag processing into its own function
Move processing of tags into its own function to make the logic easier to extend when we're going to implement filtering for tags. No change in behaviour is expected from this commit. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b2025da commit 628d81b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

list-objects.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ static void process_tree(struct traversal_context *ctx,
213213
free_tree_buffer(tree);
214214
}
215215

216+
static void process_tag(struct traversal_context *ctx,
217+
struct tag *tag,
218+
const char *name)
219+
{
220+
tag->object.flags |= SEEN;
221+
ctx->show_object(&tag->object, name, ctx->show_data);
222+
}
223+
216224
static void mark_edge_parents_uninteresting(struct commit *commit,
217225
struct rev_info *revs,
218226
show_edge_fn show_edge)
@@ -334,8 +342,7 @@ static void traverse_trees_and_blobs(struct traversal_context *ctx,
334342
if (obj->flags & (UNINTERESTING | SEEN))
335343
continue;
336344
if (obj->type == OBJ_TAG) {
337-
obj->flags |= SEEN;
338-
ctx->show_object(obj, name, ctx->show_data);
345+
process_tag(ctx, (struct tag *)obj, name);
339346
continue;
340347
}
341348
if (!path)

0 commit comments

Comments
 (0)