From mboxrd@z Thu Jan 1 00:00:00 1970 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 98F1F2C850 for ; Tue, 24 Oct 2023 14:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="ysJFVOg/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="q6jRty0T" Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9A8F109 for ; Tue, 24 Oct 2023 07:05:19 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id C9B323200A8E; Tue, 24 Oct 2023 10:05:18 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 24 Oct 2023 10:05:19 -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=1698156318; x=1698242718; bh=Bk xXEuIpNIP5gskQfRfHKB3VPm9zWsfFzv36JPmj3ds=; b=ysJFVOg/fv11CZ9ItX O1oGrtJEVl6IV7yJSNXjF0qa4ONhi7UzhqwGjFSVxLiDDPhV+mmCMxG7na18ZEGp 0b78mnlZunQf5QZFqBg0dONhWRZGH/2IL6a4D21E13QwnCNk66RoOX9hhGqFYlXW V5M8RlkO6NK1hG5yiqtCZBKyigzsKo3TAtKqztcCz+6aP7i62upTFZ9cwr6IJURE NA2JUCuWwp3Ujyf7SWF2WqovTd8BNKyesJ/EAJtbpuFKvG3UW+2qC/WCJ5gl/oEI TtpGwt25lsyjXuC5i0/8weuf1cYcXfd25m99o3+oH2NFMcMfc1X9t5Sln9/87VMj awIQ== 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=1698156318; x=1698242718; bh=BkxXEuIpNIP5g skQfRfHKB3VPm9zWsfFzv36JPmj3ds=; b=q6jRty0TzFc2c30s7/knLFLczL5J7 ikvNRTsLF3KpAh3fql+W9lAO8Bt1jKl28YxUqlNsniE3/D2i3cpTUEsiApIHhtql lZUO8ErbmpY62oYIyUV0khAFVYoybRj60Aj6vNPrtJGWDbniNlesLk/X76MKpWMl 1ueApG7vg/6Z0Umi3YcgAKgRUPsYU+NDI+L6IJHDozCzUIWT/gB4TdsqXjRa4P+q 1EH/+hYvJq0tFqXg3da92Vj/3SuLvI3wJUdSEkRVGqs0o0UNm4IlWieZuXBqYBDv yrDSeaIZT8Cl8UC9vu2XpHFpu+InG/CcNVloCGmteg9qL6yhfekaslHwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrkeekgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeeukedtvedtffevleejtefgheehieegkeeluddvfeefgeehgfeltddtheejleffteen ucevlhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Oct 2023 10:05:16 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 82bf9ad5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 24 Oct 2023 14:05:11 +0000 (UTC) Date: Tue, 24 Oct 2023 16:05:15 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Han-Wen Nienhuys , Eric Sunshine , Taylor Blau , Junio C Hamano Subject: [PATCH v2 6/9] 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-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="1JauNLPow8rS5hlu" Content-Disposition: inline In-Reply-To: --1JauNLPow8rS5hlu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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-colo= rs.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 ' =20 +remove_replace_refs () { + git for-each-ref 'refs/replace*/**' --format=3D'delete %(refname)' >in && + git update-ref --stdin