From patchwork Thu Mar 3 07:20:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12767137 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFCDCC433F5 for ; Thu, 3 Mar 2022 07:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbiCCHUz (ORCPT ); Thu, 3 Mar 2022 02:20:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbiCCHUy (ORCPT ); Thu, 3 Mar 2022 02:20:54 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C35E164D17 for ; Wed, 2 Mar 2022 23:20:10 -0800 (PST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 79E425C0262; Thu, 3 Mar 2022 02:20:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 03 Mar 2022 02:20:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; bh=t Gb8uIh5ym/N2EwHMGHV1RiBBiT7L4txzrb4BtEnX+A=; b=GXXegrr4InyVePhpv ER9oK+jLfRIHYy2uhaavRZ4+5RpcnvSjnt7Ob+nxSTbOIXF45Y+3z487kv2r+dNN VI7c6jbOaFhMXIJGa6u2War4LY9Wvldo2/7xdpkL3jeg53/DH5eNJhesiVG4CNyd LI1hmMSyX6a0f2T3mOovifJoIy32yPt7TobdyfDminch/+b87Fie/sHQi4jLYehL MSYsbr6vo+me+6bO+YWf90uhUTLG8hpw4D1sIMx8wjH63W/j2bcLfyO7+ees/Osr dmcVPjybOchh/PRM/6Lu9jlkkWxo5X2UNBZfudwNxUqlzHoxXKBb2q+FJU4ZVB59 2ED7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=tGb8uIh5ym/N2EwHMGHV1RiBBiT7L4txzrb4BtEnX +A=; b=R028UVL5xnV2U5uuNcbapaHZfENcSZq6S19vW2yVph6hBCQU1qXUYRR9P Hs71miWMR3otKGqeO7I566GY84QG2CZJI7WLXWhj9eFda0LJ6moxTY0AElXSvW1x p2b2MCp5vcOj4vNytYkPGo4g6qut9yI+2mmPkXtPY1onUNJ06kAL4cMHRo6So6j0 IlXfovl39YNUa3l/nzI8LoGHytgrQc25pr1/vRXeY/IHv9E3cvhGmlo8G8qgVQqo 2cNJFd+53LgkSORAWHB9fEn3m9oMXkI12eGNfVeG9kPUAoU+UYZ51FDGiz7jNQsj dIeTUCJjOeuI/kqyF3wf51b8UIf6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddthedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggusehgtderre dttddvnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhk shdrihhmqeenucggtffrrghtthgvrhhnpeejieefvdeuleffgfejudffvdeghfeigfejgf dvvdefudevffefveffhffgkeeiffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Mar 2022 02:20:08 -0500 (EST) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id ec446b99 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 3 Mar 2022 07:20:06 +0000 (UTC) Date: Thu, 3 Mar 2022 08:20:05 +0100 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Junio C Hamano Subject: [PATCH] t5503: simplify setup of test which exercises failure of backfill Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In the testcase to exercise backfilling of tags for fetches we evoke a failure of the backfilling mechanism by creating a reference that later on causes a D/F conflict. Because the assumption was that git-fetch(1) would notice the D/F conflict early on this conflicting reference was created via the reference-transaction hook just when we were about to write the backfilled tag. As it turns out though this is not the case, and the fetch fails in the same way when we create the conflicting ref up front. Simplify the test setup creating the reference up front, which allows us to get rid of the hook script. Signed-off-by: Patrick Steinhardt --- This simplifies the test setup of t5503 as discussed in [1]. The patch applies on top of Junio's ps/fetch-atomic (583bc41923 (fetch: make `--atomic` flag cover pruning of refs, 2022-02-17)). Patrick t/t5503-tagfollow.sh | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh index e72fdc2534..a3c01014b7 100755 --- a/t/t5503-tagfollow.sh +++ b/t/t5503-tagfollow.sh @@ -212,21 +212,11 @@ test_expect_success 'atomic fetch with backfill should use single transaction' ' test_expect_success 'backfill failure causes command to fail' ' git init clone5 && - write_script clone5/.git/hooks/reference-transaction <<-EOF && - while read oldrev newrev reference - do - if test "\$reference" = refs/tags/tag1 - then - # Create a nested tag below the actual tag we - # wanted to write, which causes a D/F conflict - # later when we want to commit refs/tags/tag1. - # We cannot just `exit 1` here given that this - # would cause us to die immediately. - git update-ref refs/tags/tag1/nested $B - exit \$! - fi - done - EOF + # Create a tag that is nested below the tag we are about to fetch via + # the backfill mechanism. This causes a D/F conflict when backfilling + # and should thus cause the command to fail. + empty_blob=$(git -C clone5 hash-object -w --stdin