From patchwork Thu Oct 26 09:56:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13437418 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6D612D02C for ; Thu, 26 Oct 2023 09:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="I/C2gXBC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="S8XKkgDF" Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D7C1AC for ; Thu, 26 Oct 2023 02:56:37 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 9A34B32007CF; Thu, 26 Oct 2023 05:56:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Oct 2023 05:56:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1698314196; x=1698400596; bh=jF 7JYayKS5xis4M1MmJCAK+0N/nnCO07b9MkD8cu1x8=; b=I/C2gXBCDLoen+N1Pq QOZfQ0feHyFTHILV6Pok1bsvusQi9vxRFUXKOJEju6H4dhMVr2iQRKjO98pA2VlN hK3gkR3636xvcfGce3uCWYT0UY7jXyQ7qS90hLKvViXIK9VFHRg7dBDkzvolTuI5 mZXlFTyARHu3dzMzUmRauBJtO5BZfUXJ7sSewjssthdY3gViaW15w+0qRzCOg1kb UYcTi1EWjk9xQyDoUX9YSEh/ypRoYzNElBmxOoejJVPjkUCpblEpgJk3RD/e88jd NzrBsoT9XccHiLLWe0MQxFPiBR4jMgVRSisz1y7pgUZWMOMizaqR/hurMaGrfp1k F7NQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1698314196; x=1698400596; bh=jF7JYayKS5xis 4M1MmJCAK+0N/nnCO07b9MkD8cu1x8=; b=S8XKkgDFl9WSfDY+GiKWaIwG3chIZ lnFW0YU6aYTyvS2v+blC8igNwTwkBDhNDsKnTFPEy0zXfsVkmbwX1xd0I6WyJZzs JJgVFiVQC2ZN2LcZJuUJF+5NXh/DrDQv4oLqrpK5GKj+9VqzToC7Y96rh2GOy2PN O/9289gUJA485q3yWjtRDardMm5qciAGpF2LxOnGPZipEJvLlfGnWponqamHkFd2 Vazn60ASTv7lUcXFdpAOuPYfwr+F+I1/SQTZ4Czi1RYl0MVK8N/AaBG5ts4OEoFy F9y4/fkjbs/hqiYwBkAXZ5h/cebsV6cxR03ndMU1t3H/pk0JtaTTT5Rqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrledvgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 26 Oct 2023 05:56:35 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c520dbbb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 26 Oct 2023 09:56:26 +0000 (UTC) Date: Thu, 26 Oct 2023 11:56:33 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Junio C Hamano , Eric Sunshine , Han-Wen Nienhuys Subject: [PATCH v2 04/12] builtin/show-ref: fix dead code when passing patterns Message-ID: <87afcee830caab2782ce693c1f961df6fea6e7b5.1698314128.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When passing patterns to `git show-ref` we have some code that will cause us to die if `verify && !quiet` is true. But because `verify` indicates a different subcommand of git-show-ref(1) that causes us to execute `cmd_show_ref__verify()` and not `cmd_show_ref__patterns()`, the condition cannot ever be true. Let's remove this dead code. Signed-off-by: Patrick Steinhardt --- builtin/show-ref.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/builtin/show-ref.c b/builtin/show-ref.c index e55c38af478..f95418d3d16 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -183,11 +183,8 @@ static int cmd_show_ref__patterns(const char **patterns) } else { for_each_ref(show_ref, &show_ref_data); } - if (!found_match) { - if (verify && !quiet) - die("No match"); + if (!found_match) return 1; - } return 0; }