Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2021-04-09 14:28:02 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-11 09:03:20 +0300
commit628d81be6c007de5aa0fa352b912b89f74a5cfa7 (patch)
treecd0cdcdbbf94ca21205f20b01b2586a0f3785c52 /list-objects.c
parentb2025da38be94568bf046c2b8520fe87bcbb5c3d (diff)
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 <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list-objects.c')
-rw-r--r--list-objects.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/list-objects.c b/list-objects.c
index e19589baa0..a5a60301cb 100644
--- a/list-objects.c
+++ b/list-objects.c
@@ -213,6 +213,14 @@ static void process_tree(struct traversal_context *ctx,
free_tree_buffer(tree);
}
+static void process_tag(struct traversal_context *ctx,
+ struct tag *tag,
+ const char *name)
+{
+ tag->object.flags |= SEEN;
+ ctx->show_object(&tag->object, name, ctx->show_data);
+}
+
static void mark_edge_parents_uninteresting(struct commit *commit,
struct rev_info *revs,
show_edge_fn show_edge)
@@ -334,8 +342,7 @@ static void traverse_trees_and_blobs(struct traversal_context *ctx,
if (obj->flags & (UNINTERESTING | SEEN))
continue;
if (obj->type == OBJ_TAG) {
- obj->flags |= SEEN;
- ctx->show_object(obj, name, ctx->show_data);
+ process_tag(ctx, (struct tag *)obj, name);
continue;
}
if (!path)