From patchwork Tue Oct 24 13:10:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13434439 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 4B3442AB42 for ; Tue, 24 Oct 2023 13:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="E8DgpqeP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HHQTN/Do" Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AFAB1719 for ; Tue, 24 Oct 2023 06:10:57 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 4D79032009B9; Tue, 24 Oct 2023 09:10:56 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 24 Oct 2023 09:10:56 -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=1698153055; x=1698239455; bh=Un EnMwirdwxAAIS/g0oVhOAzzsu8M6Daabj+bdockBI=; b=E8DgpqePzvWla5A50s vUGbQlhkbkFW3cBCEXek4I0I3Vu617688Idu6IPKn6MDEezGghOly7dBs8YDccI8 LfMs//MmjYZfBxZ1ST2du5ZM9ILLD+ClYwp4LVKTo+bxnWtV12EZE/8qiBs2pt/N QYCJn5iyhXDaxVUcFZ0opo98+UYJIi8reChOnPSwWtUUVW7uB6qqanPZK0oQFFTp 2JwYW7MZ1f41f/zKKCb8aDPWlNbriZaVBMIC2aleKxVLak4VZgHjEeeWsGKu8Mlz NeQ3Dgo7xcoG5+iFl6ZvgLvuthrzvAOBHmtr5GOdzu3u0gGEwL9t92945ednYgW9 sXlw== 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=1698153055; x=1698239455; bh=UnEnMwirdwxAA IS/g0oVhOAzzsu8M6Daabj+bdockBI=; b=HHQTN/DoOi+6HWgffYqRojuQlBCRi IYwikS3U4a57MIDFVLNj9TimEGBwdQ9STLggSNfrkiBMdb05A6BY/vEx2RyomNPC yUyoB772bajLbwQ2IXIJAxw7wVNSrQxItj5psPciRPdHpBb+PTte3reFIaUQXIht K64D2DkKMTPu/xFeOSjyxVPB9gGY0sjzDSpmGAuh8O79Y38+BgIwgAuPDUUKLFpj PTM8gV7L7PcaTODil3vn4CzgROyHG+5UujJf60WmHXJmYnxVHv2OZS+mIYsnByxS qPgXQhEL+lkJu6EYI4O59wTtG6bH7nxKZwyBFQeafHe92VFlUXfZvYQyQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeekgdeitdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Oct 2023 09:10:54 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 786e3b97 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 24 Oct 2023 13:10:50 +0000 (UTC) Date: Tue, 24 Oct 2023 15:10:53 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Junio C Hamano , Eric Sunshine , Han-Wen Nienhuys Subject: [PATCH 04/12] builtin/show-ref: fix dead code when passing patterns Message-ID: <29c0c0c6c9728f286efd0b78996f9a1394957862.1698152926.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 of `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 761669d28de..eb60f940a3c 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -182,11 +182,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; }