From patchwork Thu Nov 2 08:47:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13443521 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 81C35747D for ; Thu, 2 Nov 2023 08:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="tFYVryPP"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="a1sGANEn" Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22A3012D for ; Thu, 2 Nov 2023 01:47:06 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 246B23200936; Thu, 2 Nov 2023 04:47:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 02 Nov 2023 04:47:05 -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=1698914824; x=1699001224; bh=K8 W2Lfzuhrw+qGswr60etb591NieXmElb0DQVdVXyJg=; b=tFYVryPPvipXYGa5C0 N9UeZ2hNO6vy8MH5XWip5HU0l3Rho+sSXECgUy85+9ttd7VNq5jLqgKsWwWwLIHd PjTWiYRnO9ww+YR/3eSvhVbnmLhtqbLyAmGPkS4G90eDZ8vnDZhot9CTzZgxRnAn Mbsu5HDmR4fFrHjKHQtEKWdELytVAx8kHtawJ3TdlLdsMR17EUHRgbAbDWcPyghp 1jFP6tM9SEu4fs5IZtVJ+2rGu9wwsQtL7G8w6KvHJCzesEtQNOJVaMyBgGQ8gcG2 /Qd8yGdn4QG5SCZ0ewHpLxyE8AiufpNpwcukc0OSH3Xb4JGWaHRJL9/HjaZZZt7q MfNQ== 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=1698914824; x=1699001224; bh=K8W2Lfzuhrw+q Gswr60etb591NieXmElb0DQVdVXyJg=; b=a1sGANEnZ73vKpfXoT2ZKN+iBwDdv Km0wu0CTTZVdAjqCpVDvJ+2J+cSMpwAciYGnGM+Hu4QJ1200UTD7Vpb1c5lXM09W p7pxLMmYUBe9+8IgSNcq0Znos2SESLq54oTzMRciYq6g0g6aQKe/VHJnYtwiQ5Up GYx20vQm1Dxb/S5PNkY0Q6dUtyPXCmRxCiTGbGWIWOMPLU/2uHbg3UxUkwPFCBTR uRVjPBCkD+QOLZBugEjemU52ReY921JcDv1vIw6wUBpkGxxv3gQueipLVJdCjPjR 40NC1Nqfp50d3WkmyuXl5hX1rxedcFDrTMGws36TMOrQLrtG1audEEKrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddthedguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrght rhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtth gvrhhnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleff teenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpsh esphhkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Nov 2023 04:47:03 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id c9c9df4b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 2 Nov 2023 08:46:52 +0000 (UTC) Date: Thu, 2 Nov 2023 09:47:01 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Eric Sunshine , Taylor Blau , Junio C Hamano Subject: [PATCH v3 6/9] t4207: delete replace references via git-update-ref(1) Message-ID: <3213d45b5372a225d16971ebc9dcb5dc2b1005c6.1698914571.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: 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/t/t4207-log-decoration-colors.sh b/t/t4207-log-decoration-colors.sh index 21986a866df..73ea9e51550 100755 --- a/t/t4207-log-decoration-colors.sh +++ b/t/t4207-log-decoration-colors.sh @@ -70,8 +70,14 @@ ${c_tag}tag: ${c_reset}${c_tag}A${c_reset}${c_commit})${c_reset} A cmp_filtered_decorations ' +remove_replace_refs () { + git for-each-ref 'refs/replace*/**' --format='delete %(refname)' >in && + git update-ref --stdin