From patchwork Wed Oct 18 05:35:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13426368 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 10E3914AB2 for ; Wed, 18 Oct 2023 05:35:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="z0HgXSsV"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="I1H0RWD4" Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4488A181 for ; Tue, 17 Oct 2023 22:35:41 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 9AAF03200B3A; Wed, 18 Oct 2023 01:35:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 18 Oct 2023 01:35:40 -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=1697607340; x=1697693740; bh=ZN 0s8cpLORyMUOSR0o1dZPgGpdx3IRQztpSSJYDj9J8=; b=z0HgXSsVTq/PEqov0c 6vUCbdWa2iONxgdy+phkpUChqhlz8MYHuNgOkfU7/oSVuu48STKyZzbJ1SGOcevy qP8RUGg+JEjh/zo1it641bFdhQl4eCxkI1sxptDdUgxAJL76+6Gqn41o4I8YKLrc tO1EFyPpA3horwraMcBXnUFTl1cpyuaDFTLsdeHHhsKIUqU3oVTeUcDZtxtpiuoV FgU40/1W/pKDEREylB+lCjNAqILvKgKSstqT7B16AP6KqBHlzsdYXAecqI5qeJCx Qq87X95wlm5P1Y7Sf3i3Z2+kEjC/Y52kv5FWnd57OV0b2kXdIdvqTZRGenE3qiU8 WBMA== 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=1697607340; x=1697693740; bh=ZN0s8cpLORyMU OSR0o1dZPgGpdx3IRQztpSSJYDj9J8=; b=I1H0RWD4KPMphwU/D3EfJdC5vLGqy eVa/DTZuWk8gQhiYrSKxZxoFtPfiaILc+ZZkqj+w0yHmV0dl7daWodnD9FkzDdlz VqLDAbsgTC4H+1ax74xyziOOOE/BK1/ip/DcfdLaYmb980/hK/NFjhTPkoYZfKVT 0Zc2h8WVMs+0V+UT9nCCUHTpXOfcsFlMG3MCwqQi9LStEkbh825+ejlYS3p2w3Ro dwX4LS6Emxkxm6N8pK4KbG+7idXa0HIjQx1ERgCt4KrUXEagDNsI4NLjwCXl7zGP smvI3n5KznPYLsyL1FXUSnCAN54e7DyrwNidQgt1JFQlcSskPP9Xiw6aA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeefgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 18 Oct 2023 01:35:39 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 5a0febda (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 18 Oct 2023 05:35:38 +0000 (UTC) Date: Wed, 18 Oct 2023 07:35:37 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Han-Wen Nienhuys Subject: [PATCH 08/11] t4207: delete replace references via git-update-ref(1) Message-ID: 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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net In t4207 we set up a set of replace objects via git-replace(1). Because these references should not be impacting subsequent tests we also set up some cleanup logic that deletes the replacement references via a call to `rm -rf`. This reaches into the internal implementation details of the reference backend and will thus break when we grow an alternative refdb implementation. Refactor the tests to delete the replacement refs via Git commands so that we become independent of the actual refdb that's in use. As we don't have a nice way to delete all replacements or all references in a certain namespace, we opt for a combination of git-for-each-ref(1) and git-update-ref(1)'s `--stdin` mode. Signed-off-by: Patrick Steinhardt --- t/t4207-log-decoration-colors.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh index 21986a866df..d138e513a04 100755 --- a/t/t4207-log-decoration-colors.sh +++ b/t/t4207-log-decoration-colors.sh @@ -71,7 +71,7 @@ ${c_tag}tag: ${c_reset}${c_tag}A${c_reset}${c_commit})${c_reset} A ' test_expect_success 'test coloring with replace-objects' ' - test_when_finished rm -rf .git/refs/replace* && + test_when_finished "git for-each-ref refs/replace*/** --format=${SQ}delete %(refname)${SQ} | git update-ref --stdin" && test_commit C && test_commit D && @@ -99,7 +99,7 @@ EOF ' test_expect_success 'test coloring with grafted commit' ' - test_when_finished rm -rf .git/refs/replace* && + test_when_finished "git for-each-ref refs/replace*/** --format=${SQ}delete %(refname)${SQ} | git update-ref --stdin" && git replace --graft HEAD HEAD~2 &&