From patchwork Mon Mar 15 13:14:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12139221 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 BD122C43332 for ; Mon, 15 Mar 2021 13:15:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 785D764F0B for ; Mon, 15 Mar 2021 13:15:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230057AbhCONO4 (ORCPT ); Mon, 15 Mar 2021 09:14:56 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:39355 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229734AbhCONOo (ORCPT ); Mon, 15 Mar 2021 09:14:44 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A195A5C012C; Mon, 15 Mar 2021 09:14:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 15 Mar 2021 09:14:43 -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=utpoRoEnTPrLeARRCbgslW7vCl1 TYcgixior6fr3THU=; b=rELpKV5yKQwp7gXhijzWjZsiWZOj4PMdHP9y5ttVSRd dCipsYOYvVx7l0Ewem3rHQEniHhgmJClGB5y1aQGJAbU7N+OJl4dKLq1dGkiEFi0 DzWxpIuVk+7cKNNSvQabuK9RfgMIxcYjl0M8oHWi3gATLiff3SeVg8f+6QpX/aPb hP9xscyeA4QMjkT+9SychA+f3i5dRj2SkbibcfYjvBezoidnlUO2JzeXldPU7sak zMXCLsgc/mgC44kpBOIpPgxNGV5LP5hz0R/Ah/SJhDSWs95+PA49zaHa+wUSX+km ZBuimE7ncrNLUls0bKjCy53rCfafT8UdqWEe8yDEDpw== 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=utpoRo EnTPrLeARRCbgslW7vCl1TYcgixior6fr3THU=; b=GOS0zSRzXjuzSdhcZg348b Q9cZlzu2GCBcjrr0L96rlMxQyEDi5hBjLc/+rWM6YvnzqdTlicUAJXFP3nQ+dkjU z462k/DSgNEvVAYt6s4OsdUMYQf8KKG+3eFmirDIAfEMltPb0BUyMeS7y/MMy1J8 imwSHq3Qcqo6KfjUT+gEZ1wTRtHDgvudC+D3Zn/jaczPhjJeYfL1ZxIBl37znoP6 EYUGwByxmO5cHf9OXrrhZ320w1t4Dzv4YZNcd9lqZ7PWNN2u1ZLsxdtE+cgjBHbm Pa2tbmRSe4YlElQS5zUIlfkJAoSceuI2ilkHZfqo8hNqdZqDHVGGse373DwBeEcA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvledggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepkeelrddugedrleeirddvgedunecuvehluhhsthgvrhfuihiivgepfeenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (dynamic-089-014-096-241.89.14.pool.telefonica.de [89.14.96.241]) by mail.messagingengine.com (Postfix) with ESMTPA id DE96A1080067; Mon, 15 Mar 2021 09:14:42 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id ca555be9 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 15 Mar 2021 13:14:42 +0000 (UTC) Date: Mon, 15 Mar 2021 14:14:40 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Christian Couder , Taylor Blau , Jeff King Subject: [PATCH v2 3/8] list-objects: move tag processing into its own function Message-ID: 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 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/list-objects.c b/list-objects.c index e19589baa0..093adf85b1 100644 --- a/list-objects.c +++ b/list-objects.c @@ -213,6 +213,15 @@ static void process_tree(struct traversal_context *ctx, free_tree_buffer(tree); } +static void process_tag(struct traversal_context *ctx, + struct tag *tag, + struct strbuf *base, + 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 +343,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, base, name); continue; } if (!path)