From patchwork Mon Apr 19 11:46:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12211653 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,URIBL_BLOCKED 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 88A43C433ED for ; Mon, 19 Apr 2021 11:46:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 68F1E6108B for ; Mon, 19 Apr 2021 11:46:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238882AbhDSLrU (ORCPT ); Mon, 19 Apr 2021 07:47:20 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:56101 "EHLO wout1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238853AbhDSLrT (ORCPT ); Mon, 19 Apr 2021 07:47:19 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 59D92E11; Mon, 19 Apr 2021 07:46:49 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 19 Apr 2021 07:46:49 -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=sDDJEG8WaKOB8DgW61tKtMmQ7f3 ifwVRtzy5Mdd2fzI=; b=A6KF7FIGubILHBwh24BeAMLKxtSfSLbvX09tSthzS9q 39RZ5Akq7FN4n1RLEF0qif3s6PLpyORZqFYqz0rkc2Ubg0cY4VD8AeGewEGhOZun viPmTqr/iKYLXa1FAH9YIJqrc2l6no0mZy/9+jRaRhiAsH1qYgKypS6VAphRzDiX Av97yYgeT3CsMkqIuD7xw31lwy6pQgsD9rCr84XSEVDfaPodGQ6mfInvT4PnXkra U87Q7+EGcXaEeB0fe13YuJxadOrucSFRAB6PUpz+4mJFbApwTJ+tyNQQx59upitB xfV7Px9hBtcjaBrkUp/yKFv6QCAIKB9SDRtOp6ZFzrQ== 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=sDDJEG 8WaKOB8DgW61tKtMmQ7f3ifwVRtzy5Mdd2fzI=; b=j3pVNHci4hmrkUyJq1T6l7 h3+jI5cV/VllPJiscFatmB+i1e95F5OVpLL5TifzP8domzIWjYuO9D+ikiEM8aHq d0du7czBhLumqXTQoRdYFzLCb6e3XukS9UkFnZaPHouXstt9RYfujTgYn20cHzV7 m3o5tiCui3sB2j46ifbgKx9sOF7ffmehWINwTy6cUbBwZeOwgJXacAcxZ8hAl3j0 V6M95idQbUo4PZ7ksVyGmjHbIks0uFd4asaIkLG1Y+Iuo2DIdkJx8RlYG30nxZWU Q+lC1QAzdnvovPOSEub/G5fw8HMrz6ZOgIUfpEIvzFsx/7KlkNXvRjvhkT3xkHPA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddtgedggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeejrdduledurdeikedrkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (x4dbf4450.dyn.telefonica.de [77.191.68.80]) by mail.messagingengine.com (Postfix) with ESMTPA id 8CDE51080063; Mon, 19 Apr 2021 07:46:47 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id de706fe1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 19 Apr 2021 11:46:46 +0000 (UTC) Date: Mon, 19 Apr 2021 13:46:45 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Jeff King , Christian Couder , Taylor Blau , Philip Oakley , Ramsay Jones , =?iso-8859-1?q?=C6var_Arnfj=F6r?= =?iso-8859-1?q?=F0?= Bjarmason Subject: [PATCH v5 3/8] list-objects: move tag processing into its own function Message-ID: <21d7f06d0a94fc8b4f48f90007adb30fae18aa28.1618832437.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)