From patchwork Thu Jan 11 20:24:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13517776 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03D1057301 for ; Thu, 11 Jan 2024 20:24:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KPu42hkW" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40d87df95ddso59337105e9.0 for ; Thu, 11 Jan 2024 12:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705004672; x=1705609472; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vk25/eZlxl8u4iPIA5L+Ftvzh5T6CrtWT2SShPD/2p8=; b=KPu42hkWqsfLb6KBiZKT0Se9gqgA5sGAvV+ypBzTKAfNIqFb0wqpN0+XUf4fOzyQoQ mOwfltsCwuqlVaf5Hp1/UMEnSWIy5NQELp9GzLgHJ8GBB6SZFUNcQ7s48PErU9utvupc rOmhTv8xHkDnnYx3seYx79eDdxVMSSyIIKIhuFUwtKevqyfCs55O553Xb6fPAbjNBhFB eKEWQknmTI83tKr1iur+m4A0QfIa6723PYLH+16qLoq1FkrhLyHrSmJFP8f2Cuj8EaKH /2cfGl64oRV9Vdo7A5Ul26WfcdTHMquscMwvvBZBmPDh1NnCK6Xu9i0ZJ1ban+n1fT5u LM9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705004672; x=1705609472; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vk25/eZlxl8u4iPIA5L+Ftvzh5T6CrtWT2SShPD/2p8=; b=MLvuUWfhnkX2Ak8PNhFHkBWMXAXoXjaX3WZ0tFdXeRIdrq52I3g2yYBvcM0j0BKlWe hp/FeDwGzzS1+tyMS8hPRBi/Bz36Oah+Bh7fCmBflgR1bSNAS1o0ExDFmdceq8CXN3Yb QakNt+LEqX5zCrpC0ZYRoSXRPjfnDVvjf/j4fVADsX6GxE0ZFhSoz/WlshwpuaP8rBqw /aiOuFeUqebbVynt/aXwIrRW+pYz0Y2d6CFyLUeb9IcVt/417yFdGlH5byIemuh9Xc02 LUAGl8py5ItF3eaKqiDtS5ikJJTymaZSsbEzao/OR+bIE/cFfuqPAcPVzQPkMOZGi4aE yIgw== X-Gm-Message-State: AOJu0YywvPPmGP6etDAAB0464Q4nqYxvs20RXEkKvSUeTYwUvBlPThL3 klz00FSJrq0i28BwxRave9Tzb3oKy/g= X-Google-Smtp-Source: AGHT+IGTlCc0SSrgmllLg/USs189yTaXBmPtmfTDAWzRXkSMaxZ+kRQF1TviTfjP2CwKphQCoNoZAg== X-Received: by 2002:a05:600c:1c1e:b0:40e:35c3:3720 with SMTP id j30-20020a05600c1c1e00b0040e35c33720mr113487wms.23.1705004672149; Thu, 11 Jan 2024 12:24:32 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q20-20020a05600c46d400b0040e395cd20bsm6972542wmo.7.2024.01.11.12.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 12:24:31 -0800 (PST) Message-ID: <714f713ccece4a9dd167b3b73a71c068dbe91f53.1705004670.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 11 Jan 2024 20:24:29 +0000 Subject: [PATCH v2 1/2] t1401: remove lockfile creation Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff King , Patrick Steinhardt , Justin Tobler , Justin Tobler From: Justin Tobler From: Justin Tobler To create error conditions, some tests set up reference locks by directly creating its lockfile. While this works for the files reference backend, this approach is incompatible with the reftable backend. Refactor the test to create a d/f conflict via git-symbolic-ref(1) instead so that the test is reference backend agnostic. Signed-off-by: Justin Tobler --- t/t1401-symbolic-ref.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh index c7745e1bf69..c67e5c134d9 100755 --- a/t/t1401-symbolic-ref.sh +++ b/t/t1401-symbolic-ref.sh @@ -106,9 +106,8 @@ test_expect_success LONG_REF 'we can parse long symbolic ref' ' ' test_expect_success 'symbolic-ref reports failure in exit code' ' - test_when_finished "rm -f .git/HEAD.lock" && - >.git/HEAD.lock && - test_must_fail git symbolic-ref HEAD refs/heads/whatever + # Create d/f conflict to simulate failure. + test_must_fail git symbolic-ref refs/heads refs/heads/foo ' test_expect_success 'symbolic-ref writes reflog entry' ' From patchwork Thu Jan 11 20:24:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13517777 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D37757304 for ; Thu, 11 Jan 2024 20:24:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mAAvw/QE" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40e586a62f7so25353365e9.2 for ; Thu, 11 Jan 2024 12:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705004674; x=1705609474; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=D9vmFsAbf2tGEgXK5XRtlPnSYwJuGcsi2DCZKBbDduE=; b=mAAvw/QE8OADn/D3CW8HDx9VGAH1Uk3aWqH04tYCamfMN3wFU3+dtUsxX9j9sFISFx ItjU5JXh0K2VDuhlLQMCi75TALHdIaC6NJ4HnShn2WdHFKm9QyYMIS7Np/TiiwmksN5x +Ktjn8QJdpnkD8yJVfmgxWcENsL730f33QxD+SVWCAnCkFmyQ6t7N+Fg+svKF1TAWNfB iP+ZNbbQmocjd31tmFsvS1oND/lGBOskRdX0mQTVjRXcCcPLjZhs7ijB8wHF5Q8ED9kF fA58bKHJhn89S5GSCBC5u4RGWZwIFqZNQgWnGKknAGrV31xuPGJPnKgHvoESUp5P6hvY MUrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705004674; x=1705609474; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D9vmFsAbf2tGEgXK5XRtlPnSYwJuGcsi2DCZKBbDduE=; b=dHEGWjURfTZJAdZRVC62aU+BOW4Ecf9uq+uwI8jKGGZANSsWu2vkcnkdJB6v7i+zRU a5EuX5+LufVZlHm2G4mKSt5RVKihlYAKLUNXWZAkdq7KinzFnjtsFotBNshBH2vIsCyc kOtKcqZsoS0aZwm6Cz3hCspOjW+R9DhzkKdrKnmKI6AkdBPpjA5AhzGwmzEQvoBKrz4j VdbdT/h/5vaDPnCGihIuHEN38nDKaUPth20pCaeawtkAwTfiEImIxu9ZhwXjqRHSU8ni ZP0yXalBIC4zoP9fIixxblxMG7Ivqsig/q8L+NK3vO3FQZLLDvc30ZB2x2C0ZD3GZGEU PlaA== X-Gm-Message-State: AOJu0Yw+Msc4KnGExFtYl/hfQwxyhd3m9Hb9owCCMFrCryvoffG0tyhz mZzc0t6cO8ouaMmzstD0aqK+H3DGyxE= X-Google-Smtp-Source: AGHT+IFqCvtk2ywF3WPwAZXav53a8c69QTwP5OTdhrLWfOkCSl2/sqbOw9AV1zX+/BQy1XfWB1gqDw== X-Received: by 2002:a05:600c:4686:b0:40e:3511:2c39 with SMTP id p6-20020a05600c468600b0040e35112c39mr245555wmo.172.1705004673668; Thu, 11 Jan 2024 12:24:33 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m26-20020a7bca5a000000b0040e54381a85sm3056983wml.26.2024.01.11.12.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 12:24:32 -0800 (PST) Message-ID: In-Reply-To: References: Date: Thu, 11 Jan 2024 20:24:30 +0000 Subject: [PATCH v2 2/2] t5541: remove lockfile creation Fcc: Sent Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Jeff King , Patrick Steinhardt , Justin Tobler , Justin Tobler From: Justin Tobler From: Justin Tobler To create error conditions, some tests set up reference locks by directly creating its lockfile. While this works for the files reference backend, this approach is incompatible with the reftable backend. Refactor the test to create a d/f conflict via git-update-ref(1) instead so that the test is reference backend agnostic. Signed-off-by: Justin Tobler --- t/t5541-http-push-smart.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index df758e187df..9a8bed6c32b 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -232,8 +232,9 @@ test_expect_success 'push --atomic fails on server-side errors' ' test_config -C "$d" http.receivepack true && up="$HTTPD_URL"/smart/atomic-branches.git && - # break ref updates for other on the remote site - mkdir "$d/refs/heads/other.lock" && + # Create d/f conflict to break ref updates for other on the remote site. + git -C "$d" update-ref -d refs/heads/other && + git -C "$d" update-ref refs/heads/other/conflict HEAD && # add the new commit to other git branch -f other collateral && @@ -241,18 +242,9 @@ test_expect_success 'push --atomic fails on server-side errors' ' # --atomic should cause entire push to be rejected test_must_fail git push --atomic "$up" atomic other 2>output && - # the new branch should not have been created upstream - test_must_fail git -C "$d" show-ref --verify refs/heads/atomic && - - # upstream should still reflect atomic2, the last thing we pushed - # successfully - git rev-parse atomic2 >expected && - # ...to other. - git -C "$d" rev-parse refs/heads/other >actual && - test_cmp expected actual && - - # the new branch should not have been created upstream + # The atomic and other branches should be created upstream. test_must_fail git -C "$d" show-ref --verify refs/heads/atomic && + test_must_fail git -C "$d" show-ref --verify refs/heads/other && # the failed refs should be indicated to the user grep "^ ! .*rejected.* other -> other .*atomic transaction failed" output &&