From patchwork Mon Apr 12 13:37:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12198081 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D363C433ED for ; Mon, 12 Apr 2021 13:37:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DDA096128C for ; Mon, 12 Apr 2021 13:37:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241962AbhDLNhz (ORCPT ); Mon, 12 Apr 2021 09:37:55 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:50367 "EHLO wout4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241957AbhDLNhw (ORCPT ); Mon, 12 Apr 2021 09:37:52 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id ED6531681; Mon, 12 Apr 2021 09:37:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 12 Apr 2021 09:37:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=NylQZS62uBrE3ZBQTRLMOEeAaC7 haJOlaQ328Y77S2w=; b=CJhwHFw6Skmqvj9zv09/RdGt/4BFs9YZwKr8tZ3rAGg FJkpeiE315U6Gjuk/tUcYXiChsCJdMuNGTn0mfUXO9vcSB6X3EpNplIGJMFEXr4j zoljdbczugQ3cVnHosx7QspCsq8e3GjKcU664/dDe7HhwgQAd2x1tPpX6Bl4auuz AB8RQEdZ+6Kmtchkoz7hvEtcrcEGcR+NJAPjEvygh57mZ/jibHFAZd/D0yWNEN5W WTtWLzyJlviDV34JnQbUm9/lrSHnZroUJ4Fsq0mWtnGCHlMfUF7wgl2yoJFAbvOC XMrHxqXdtRpI6rqDQXBIazqbXorsYudmEroIO0ThTrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=NylQZS 62uBrE3ZBQTRLMOEeAaC7haJOlaQ328Y77S2w=; b=Yt/BALkIefaXNYgONy0ppy XOhIX0zFMtPrTsf1K/ZZz4bMXRIlh4qY4OCmciM4GRqb9KOobEWWneIm5b9tq2vq CL5I0f6JSF1lWxNl4vySa8psojJQ60RW9C9OgLVGDWHKuSdC3PltEd9ekHAwG4Ps zYihn4dOU9NJxeKK3CghgNhBHoq7knfFW/yL5FmTxdzOQ1RUywVZpu7VocNYG2Mj 60AiFhEM+BGjOwe+XSe7YUN42BGV5jTxZ1bAxsuzGG5yO0UjnGxpCF8ezTBH/+/5 xyGfrA3e7JRsuEi8Ttf3HpJRON4aKuGZBvl7S2BOJmKEHvrfRyBaOqip2bzKPjjQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekjedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeekrdehhedrfeehrdeftdenucevlhhushhtvghrufhiiigvpedvnecurfgrrh grmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-078-055-035-030.78.55.pool.telefonica.de [78.55.35.30]) by mail.messagingengine.com (Postfix) with ESMTPA id D4EC324005B; Mon, 12 Apr 2021 09:37:32 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 1a8f906d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 12 Apr 2021 13:37:31 +0000 (UTC) Date: Mon, 12 Apr 2021 15:37:30 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Jeff King , Christian Couder , Taylor Blau , Philip Oakley Subject: [PATCH v4 3/8] list-objects: move tag processing into its own function Message-ID: <3d792f63390da79a6d225de51bdfc651234cf893.1618234575.git.ps@pks.im> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org 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 --- list-objects.c | 11 +++++++++-- 1 file 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)