From patchwork Fri Jan 19 20:18:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524142 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 9D5B355E66 for ; Fri, 19 Jan 2024 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695546; cv=none; b=ZXedNu2rIiwAjHjaI0bfZTVpaZb33AOP4Mk6t3H2FQGE0k9YNl1oPK1tUixJ3ITsjFQW3DjMXpbEVZiCzqHF2p2M25liDmeCl+/AountkXa3XwtvE0wkT6hqne59SqaTX1IqNOZByzEin8W3Jb06aERT/B4bUkJlMULyL7loh5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695546; c=relaxed/simple; bh=XLaRIGfRIT+lsUqMekTNbLXNJHOwyY+Om+SqIbNbJnA=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=VnG884M111ZL1kyPkZsjwlhbFV3Cl06I6ufTOe5HF3Zux9duPiPzhaS3aL8cyAvoCfMR+6ucyLawreXc3alomS8f7iv1zhuRKhsoM6Oow9Sh8Wu2Te6WC9q83OtoxMVejasFVQUlj05/7pt3g/kQQRzDac2xmyE9kVnkXWmrAbc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=keSgFah6; arc=none smtp.client-ip=209.85.128.52 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="keSgFah6" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so12491975e9.3 for ; Fri, 19 Jan 2024 12:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695542; x=1706300342; 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=OHVnONCg9pxZuuWVW5p2OykS2DQHRcqKQTpknldftx0=; b=keSgFah6w1BDgxnuUkNnl3QXxRgCk9dZ7c3s/lmfyzo/gyUlaHZUkDsv/LBMF/ilnt mWWqscayYYvPu/Xr8fWmLQBesKPa+AVv/OaKW4sXUj9n2lGCq4ddx+uzyUWfjO1JGgHY uulsPUCjaHYoLM5WcWlzLg1ZO3oKvcDE2ImhrneS+m3YM0FqqMOQQmewK1pVO0rrxucQ T5nTIUCnkImI/XiKT2qn0+y2hOSWCuVJF7k11xEvL6yR3rGAN9ay5VKuREUM2ry93jz1 O6jqMDldkp7Hvr3723EnMKZZe1ILEKHWqQbPJxhv75rnZiq0g+GAXrWpwAIL1nWt27cI I+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695542; x=1706300342; 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=OHVnONCg9pxZuuWVW5p2OykS2DQHRcqKQTpknldftx0=; b=T+jccxS1If5ZwCNGSqM9A7J+6DYOC5MGZ5r7JSovFQnMOY35WRPYr7cbv9HCd20AG5 1U/tVU+SjsAq7xaRpuqTIPkkvBbPIWT/aN0AOwvxVfXUjSTBHS29KD5h/ciuQCyWqiFJ YQqTYWiOlXY8tFHVOyGA6VAkBFsiY4wytWKbbVl5N82jP2lueiQ0vLKoZ72uvvfz/tTM I0VFGhxevcnfL4cDOHM+uNZGd2Z51cPeISVNnnQuhWuQd6zBW4w2Fa9Qv/tDFBpcbMlO QpIGU8EBzrgwe01AXelpv7uUfhWafiTWVFWhGrq6xpNY1I/+pZSLIykKQ+YZlmV/tYcr llXQ== X-Gm-Message-State: AOJu0YzrIufWXmwtPdsiwIvxhplrUsc6oON5AVFl4TPVeRJPMkpZHDR9 XumDpPVJguTQyyv60It/AzOJfGdJhl8B1K+2uYjNix5OAg8O3E8alqnjYXfZ X-Google-Smtp-Source: AGHT+IEEaxWe9ZUI8YbDjWc8vuwpAbOImr3vhFiqjUbDfdpjLHk1Q9YCfasKBrbR+FB4nF62akGtzw== X-Received: by 2002:a05:600c:4510:b0:40e:80be:c9dd with SMTP id t16-20020a05600c451000b0040e80bec9ddmr174689wmo.98.1705695542267; Fri, 19 Jan 2024 12:19:02 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id r17-20020a05600c459100b0040e88fbe051sm10080451wmo.48.2024.01.19.12.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:02 -0800 (PST) Message-ID: In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:49 +0000 Subject: [PATCH v2 01/12] t3210: move to t0601 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move t3210 to t0601, since these tests are reffiles specific in that they modify loose refs manually. This is part of the effort to categorize these tests together based on the ref backend they test. When we upstream the reftable backend, we can add more tests to t06xx. This way, all tests that test specific ref backend behavior will be grouped together. Signed-off-by: John Cai --- t/{t3210-pack-refs.sh => t0601-reffiles-pack-refs.sh} | 6 ++++++ 1 file changed, 6 insertions(+) rename t/{t3210-pack-refs.sh => t0601-reffiles-pack-refs.sh} (98%) diff --git a/t/t3210-pack-refs.sh b/t/t0601-reffiles-pack-refs.sh similarity index 98% rename from t/t3210-pack-refs.sh rename to t/t0601-reffiles-pack-refs.sh index 7f4e98db7db..f7a3f693901 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t0601-reffiles-pack-refs.sh @@ -15,6 +15,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if ! test_have_prereq REFFILES + then + skip_all='skipping reffiles specific tests' + test_done +fi + test_expect_success 'enable reflogs' ' git config core.logallrefupdates true ' From patchwork Fri Jan 19 20:18:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524144 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 96EC656748 for ; Fri, 19 Jan 2024 20:19:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695547; cv=none; b=dVn7zOqcwWgBjt34LJ39DBbj8YzbVsKCMmH0JXed5xs35Yd/7zHKTYxMHtiNo5vCYCkvQOuxnHmGTFI1A1ceMFAaGJkuBGv2Lheg+aeRnTtYJkfw5GqXqBsAH0aQkq1heaV3B+BfBzHURIwqtJmlmp+dlIkCcMxzFgEb4wdXTgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695547; c=relaxed/simple; bh=j0schq5v4lqqg4ce3At9Aj9BOcebxauq2xI/a5+JCLY=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=BHbcTcLeaS1nVsY0xR5rLGJrUYke1Oi2pzwH4iyN3gXQWKEs4cEXfv3Cn33BdvR8Z8hR4jJWDDKrdCSKdp1mcOBOqEpBzhL0aMyXfKJ5weMPoccuk2DwIp56mgxzUM6Kxdm2+cXnKzbfAINzOyOFh5o2eK4xfAwDpECWYTbdx64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lZgT1yZP; arc=none smtp.client-ip=209.85.221.52 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="lZgT1yZP" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-337d05b8942so1161182f8f.3 for ; Fri, 19 Jan 2024 12:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695543; x=1706300343; 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=4y67568yoGGZeGE8rxJjvzBSLHPQi5Sa0wc/oFKt0R8=; b=lZgT1yZPDQfPwfCY1ggXT3G/cYQUDI2/CPtFtSBezUb9cKZ2LiU+kTP5otpS8jP7vx glQKT+35PAOXghp1L8BQKCz3oZI0w8YtDi0zMbhg/Lx2k9N9OhgVEm4b7mIlhsC9iwTM sh6/U30LNA6TlbJ0vFALl5LP03yBGfg2FsDq5cHB/pvukqDSZSiY2zMh4PGw1dJscDtF SMCUprwynQ0ZPrF6bRSe77IhfRGuNFqyrIleHUEqh7BeIpxuS2sYO4FDMKqTxeUTIdBw o6TbjIw6ebHapkjh9yzgOM8ZRkovse/ZLEMXltXc606trLSyu/SQbyYoZzq0ZmZJWpo2 6+Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695543; x=1706300343; 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=4y67568yoGGZeGE8rxJjvzBSLHPQi5Sa0wc/oFKt0R8=; b=rYj7r3BlyMft6MaQHxOyiJj3lG45v0mkYb67usiuQgxWa8ZsOlX8+eJKqBz8K5SsKx 91MmSOtqoyUEfgsdP/Rb8w4aSVesitSaqtdtRecmjsQN+MHaJPMQ/dGopB4el6KgZAuk 6mpP2B48MX922grzl8wcIhE5c37OQs2WJR57+j2ykIzKKV4p5emq+6nGBnmknkMIRSNR fn4Oj/IyO5zOM5KVSYN+qqvzH0/6NLQ7wB1+uJUIFPDaPbo+44h7gVIu8oRXedxfE9TU OCA5cQElGsmeocYjrzy9fyoBaeSxxtbyyGNBqXDzlIyZfv+zskIBzT2mHL+inLqSqkQM /EFQ== X-Gm-Message-State: AOJu0Yx6SKYRj5MzTokKDw4d2VxN/fmMsrq8WoQpzyTsbeLde1oS5wkX grMTtXpyv/tqws0uCggpcFIztf6xtVkyqw1b0nar3J0Q1JF7F87BgpDhkGXZ X-Google-Smtp-Source: AGHT+IHyvIzbCVl9e6HNxDvGClRhITkaLMrb7F9TiIEPZMoHLQLA/FAR1b0qPE+ELkllc0oLVCrluQ== X-Received: by 2002:a5d:5907:0:b0:337:c4da:9f3d with SMTP id v7-20020a5d5907000000b00337c4da9f3dmr163122wrd.2.1705695543422; Fri, 19 Jan 2024 12:19:03 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j6-20020adfb306000000b00339208ecb30sm2265824wrd.68.2024.01.19.12.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:02 -0800 (PST) Message-ID: <29c32d3e6f7c5dbea53705782a9d4371655afd2d.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:50 +0000 Subject: [PATCH v2 02/12] remove REFFILES prerequisite for some tests in t1405 and t2017 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai These tests are compatible with the reftable backend and thus do not need the REFFILES prerequisite. Even though 53af25e4 (t1405: mark test that checks existence as REFFILES, 2022-01-31) and 53af25e4 (t1405: mark test that checks existence as REFFILES, 2022-01-31) marked these tests to require REFFILES, the reftable backend in its current state does indeed work with these tests. Signed-off-by: John Cai --- t/t1405-main-ref-store.sh | 2 +- t/t2017-checkout-orphan.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index e4627cf1b61..62c1eadb190 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -112,7 +112,7 @@ test_expect_success 'delete_reflog(HEAD)' ' test_must_fail git reflog exists HEAD ' -test_expect_success REFFILES 'create-reflog(HEAD)' ' +test_expect_success 'create-reflog(HEAD)' ' $RUN create-reflog HEAD && git reflog exists HEAD ' diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh index 947d1587ac8..a5c7358eeab 100755 --- a/t/t2017-checkout-orphan.sh +++ b/t/t2017-checkout-orphan.sh @@ -86,7 +86,7 @@ test_expect_success '--orphan makes reflog by default' ' git rev-parse --verify delta@{0} ' -test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' ' +test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' ' git checkout main && git config core.logAllRefUpdates false && git checkout --orphan epsilon && From patchwork Fri Jan 19 20:18:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524145 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 99E255675D for ; Fri, 19 Jan 2024 20:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695548; cv=none; b=QF1GnhwnwdUXH1ERld2thuBrViw77fEdGtIbZdCy7/chXCl0vcLRhc2X6SnT4TLW6JnChT4Fp8Slqa2s2U5x2V8qdwP897SyyhHO7nkSkzTb8KaBcW4unOin3CmPjp2ON8ooV9NeiA1jzB2yjRn0qRg/TUif5LJi/ulPd832vls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695548; c=relaxed/simple; bh=+fAmqXeyTI0TgooGuGV5VjcyJfLYQKyJJJYBXwmeKT8=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=DN0QvCKpio7oU5cRB6NK6pygLXaha4KVNMOQtPMoXYWb79ZnWEoaaZrslmHb9GWhmXrIkxJw1w7phEiPonJ2MF5eDI1pj1g2dxS43JFzaaoyIJI1SONX36pIKUUOI6IvCzor2aqI3S+mvPxNHLieqXiFvEhs7S+9O+AqEDV90zg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X5UaH+j0; arc=none smtp.client-ip=209.85.128.46 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="X5UaH+j0" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40e9d288f45so12277225e9.2 for ; Fri, 19 Jan 2024 12:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695544; x=1706300344; 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=8sqab6Uhq1OPsAJMlNnyFACdeKriyuW8E+82dC3/oI8=; b=X5UaH+j0FJjm5rY3C6PQnqR5UXc38MHb+RePco0O5fujTWSAoN3YjVQA7iDKGCYHgT 0jkWe2X2yj3ekQDTc9GUkv8MSFMUpIF7VwMeI5pxj1e3E7TdkCj6JwxARjdtRacfoQ42 Z9UDr0/BL6e1q2fz9sc4aILJHz63s49+1QTI33shImrPjSslQkm38KWTesbdKY+yTpdU c7eFjSrtKQZaMV/Zib6k1h7MVLT5KOqGdBlhJ5d5j9jkqSexAdlKI6Vpxx8ulsqLzCxn jIre7Yh7dPypWA/cBhgUmXbw/+TRBfCVOYQwowzZSWVGmAJsIPCRy9jws8OGtj2FView QbNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695544; x=1706300344; 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=8sqab6Uhq1OPsAJMlNnyFACdeKriyuW8E+82dC3/oI8=; b=mjrpzT39kiMkudhURD0vonx49dMNtWXi6X7xIgjwglOaqLP6LJicj96/6yz0LU0BtJ JLzgqAlz3XdzROmDnHLfjXfEg0lRh30SMru96j8LyiQPviYOJ7nTcVcMnX2oOlUAkTvL XgnIMXOV7QHUTxm6hILmIIeQSRyTy+6++3yuq1QtKuLKcDJcl6vW9HiQ4B0l6DMjtUgp 1fgu2bHybiAyBS/ANVqrbt5hx0MfB7vaV0Kd4TSZQjUCuC9ld1EBzVueQO83qF4P/L9+ uWWb0i2ns1L8SdYdokmryTO8lht35vQRrlMotyw1UHpZhAhL7lPsC5KcQIFxTTGFsK4b iX/g== X-Gm-Message-State: AOJu0Yxgg60MKwHVSduri+bv/LvnnyT04c+0OCrSCMnyix8oaWdOXuYc bB9LGOzgtelQz88FULFTKyJ4Yi8wonURb4EmcsINLe1YZp6R/L98W7PFmJk2 X-Google-Smtp-Source: AGHT+IHf5VUfDu5vhx5pgOzsOYbFvKH4RuWOmBPh4/COxp7WApdNmXbUO4Zj2l3dtOb8dZnXPcdfVQ== X-Received: by 2002:a05:600c:22c3:b0:40e:4abf:61c3 with SMTP id 3-20020a05600c22c300b0040e4abf61c3mr118061wmg.85.1705695544365; Fri, 19 Jan 2024 12:19:04 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q14-20020a05600c46ce00b0040e7306f655sm19813570wmo.22.2024.01.19.12.19.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:03 -0800 (PST) Message-ID: <122d19a909536b570d4e1fd28228279616604ece.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:51 +0000 Subject: [PATCH v2 03/12] t1414: convert test to use Git commands instead of writing refs manually 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai This test can be re-written to use Git commands rather than writing a manual ref in the reflog. This way this test no longer needs the REFFILES prerequisite. Signed-off-by: John Cai --- t/t1414-reflog-walk.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh index ea64cecf47b..be6c3f472c1 100755 --- a/t/t1414-reflog-walk.sh +++ b/t/t1414-reflog-walk.sh @@ -121,13 +121,12 @@ test_expect_success 'min/max age uses entry date to limit' ' # Create a situation where the reflog and ref database disagree about the latest # state of HEAD. -test_expect_success REFFILES 'walk prefers reflog to ref tip' ' +test_expect_success 'walk prefers reflog to ref tip' ' + test_commit A && + test_commit B && + git reflog delete HEAD@{0} && head=$(git rev-parse HEAD) && - one=$(git rev-parse one) && - ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" && - echo "$head $one $ident broken reflog entry" >>.git/logs/HEAD && - - echo $one >expect && + git rev-parse A >expect && git log -g --format=%H -1 >actual && test_cmp expect actual ' From patchwork Fri Jan 19 20:18:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524147 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 C466256B96 for ; Fri, 19 Jan 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695550; cv=none; b=H+wELmS68LuLbbdY6bXgW9O+ooKKl2lpggAxeMec9YJuKifqKzbVfSKrWM20eqdcGESWYi+Mn4vMyqmP7QRQqd1D6Uquiupfoxa4WlgNdWnk6kQp+1lhO/0qzBOj+J/RfWlsDwyH2MrYDC3qPbuOkgfBOJCP5uZY0aTAWgfQkFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695550; c=relaxed/simple; bh=qAES9YaWNranJ/lJXueGiyAl/Ee/S/jRLyomz5xuSEc=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=sCb4ZupcfvFO36aVQXzgKPWdI47TaLeaxb0KVKacK3Qx9ab8WsWqfiHyu6CFwe426/SURkUsFX3z1yoX1RYLcTJhl/IrbmcDOXAibSSRhVQYH5VX1VIP88L6DPWC7wqsoi3lVP6rw8UZJZfehp/jdDNo1GRdh0ZKuLHzhL7VSXA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=g3Gy49Cw; arc=none smtp.client-ip=209.85.128.49 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="g3Gy49Cw" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40e5afc18f5so12492405e9.3 for ; Fri, 19 Jan 2024 12:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695545; x=1706300345; 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=OaMkTSmnhZAcYej+S0xa0GjaKrm2ThHqQBwsIjiqv2o=; b=g3Gy49CwstcO/E3r/j6sSgogv8kIJZnmyatr/5UJyQherYCcl+d4qMXVXeMHihJh5S 1kMcVrVRoV0iqH7mh+Z75um0irlaA0wOLplv/X2dJYS5JEnXzrVsiwz0zf85yJLExsa+ j5D+tiwkSwIpssvAsBgPMr91PMyD4MnqkG0mrTcPttb1hPYy0fdgMTksOX16pCMHdYEL 4rLeSqz75HViZ6d16SWP0t74QtmIQnHVkB2URUy2+D6JcmslQn7/6u71g+Em9NoPKJ/T sd7s/bYssamvnzY4NUHoyDUZk1H+N8pAtea2ULfythAECXfJxWq8toSGRngE+xhnMlQo mPbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695545; x=1706300345; 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=OaMkTSmnhZAcYej+S0xa0GjaKrm2ThHqQBwsIjiqv2o=; b=eT7GwU5bNXaymwA4X3/3iavChNC4meRmj4zOkrHHZx58ctCPfD0+wfO+W6ICRF52fu sQISvqQWZdJjzUjum7RFGQfp/F1OseRDcQPu35RhCg5vTKDeMepLpeYp0Q4WNZidQ8ON Ydg18MOMaBOcKfDU+wB84qmQEWPe+7uV/C41Boowb46zIWsxiFKX4NT0nsl2Pw8M12ev 1DSqSxhTanHRTMjh6oijF+1oXyBWgS2oEWsccwOLavySexGLJpyA/9/ELJ32b9brEcAi tE1tiIifzAQSEE8xuiPxrG3uV6eD6sFJMnCGPbIoslwczF5N04fxvPhLhWPa3KrnSd+7 4G9Q== X-Gm-Message-State: AOJu0Ywi1/iGXjja0KXWkgrF0FFNxmWQN1jcck7OxhwL8Lm06zt4Y20l 1c9WEQBZUSkr3v89ozuSIy5o1EGTnUGgYG+ye4G5ziPcnMrnZmEFiGMumEP/ X-Google-Smtp-Source: AGHT+IFCMvB/Zs1B7hvhMKXWDlSY1NnqWsqAh+ppiAU12Oe43F8tE3YOpTJqb6/3DuGoGz2OZwOWwg== X-Received: by 2002:a05:600c:4a15:b0:40e:50d8:25c6 with SMTP id c21-20020a05600c4a1500b0040e50d825c6mr173387wmp.150.1705695544955; Fri, 19 Jan 2024 12:19:04 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j16-20020adff550000000b00337712b065dsm7213430wrp.99.2024.01.19.12.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:04 -0800 (PST) Message-ID: In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:52 +0000 Subject: [PATCH v2 04/12] t1404: move reffiles specific tests to t0600 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai These tests modify loose refs manually and are specific to the reffiles backend. Move these to t0600 to be part of a test suite of reffiles specific tests. Signed-off-by: John Cai --- t/t0600-reffiles-backend.sh | 263 +++++++++++++++++++++++++++++++++++ t/t1404-update-ref-errors.sh | 237 ------------------------------- 2 files changed, 263 insertions(+), 237 deletions(-) create mode 100755 t/t0600-reffiles-backend.sh diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh new file mode 100755 index 00000000000..2f910bd76ad --- /dev/null +++ b/t/t0600-reffiles-backend.sh @@ -0,0 +1,263 @@ +#!/bin/sh + +test_description='Test reffiles backend' + +GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main +export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME + +TEST_PASSES_SANITIZE_LEAK=true +. ./test-lib.sh + +if ! test_have_prereq REFFILES + then + skip_all='skipping reffiles specific tests' + test_done +fi + +test_expect_success 'setup' ' + git commit --allow-empty -m Initial && + C=$(git rev-parse HEAD) && + git commit --allow-empty -m Second && + D=$(git rev-parse HEAD) && + git commit --allow-empty -m Third && + E=$(git rev-parse HEAD) +' + +test_expect_success 'empty directory should not fool rev-parse' ' + prefix=refs/e-rev-parse && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + echo "$C" >expected && + git rev-parse $prefix/foo >actual && + test_cmp expected actual +' + +test_expect_success 'empty directory should not fool for-each-ref' ' + prefix=refs/e-for-each-ref && + git update-ref $prefix/foo $C && + git for-each-ref $prefix >expected && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + git for-each-ref $prefix >actual && + test_cmp expected actual +' + +test_expect_success 'empty directory should not fool create' ' + prefix=refs/e-create && + mkdir -p .git/$prefix/foo/bar/baz && + printf "create %s $C\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'empty directory should not fool verify' ' + prefix=refs/e-verify && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + printf "verify %s $C\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'empty directory should not fool 1-arg update' ' + prefix=refs/e-update-1 && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + printf "update %s $D\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'empty directory should not fool 2-arg update' ' + prefix=refs/e-update-2 && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + printf "update %s $D $C\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'empty directory should not fool 0-arg delete' ' + prefix=refs/e-delete-0 && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + printf "delete %s\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'empty directory should not fool 1-arg delete' ' + prefix=refs/e-delete-1 && + git update-ref $prefix/foo $C && + git pack-refs --all && + mkdir -p .git/$prefix/foo/bar/baz && + printf "delete %s $C\n" $prefix/foo | + git update-ref --stdin +' + +test_expect_success 'non-empty directory blocks create' ' + prefix=refs/ne-create && + mkdir -p .git/$prefix/foo/bar && + : >.git/$prefix/foo/bar/baz.lock && + test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ + EOF + printf "%s\n" "update $prefix/foo $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ + EOF + printf "%s\n" "update $prefix/foo $D $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err +' + +test_expect_success 'broken reference blocks create' ' + prefix=refs/broken-create && + mkdir -p .git/$prefix && + echo "gobbledigook" >.git/$prefix/foo && + test_when_finished "rm -f .git/$prefix/foo" && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken + EOF + printf "%s\n" "update $prefix/foo $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken + EOF + printf "%s\n" "update $prefix/foo $D $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err +' + +test_expect_success 'non-empty directory blocks indirect create' ' + prefix=refs/ne-indirect-create && + git symbolic-ref $prefix/symref $prefix/foo && + mkdir -p .git/$prefix/foo/bar && + : >.git/$prefix/foo/bar/baz.lock && + test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ + EOF + printf "%s\n" "update $prefix/symref $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ + EOF + printf "%s\n" "update $prefix/symref $D $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err +' + +test_expect_success 'broken reference blocks indirect create' ' + prefix=refs/broken-indirect-create && + git symbolic-ref $prefix/symref $prefix/foo && + echo "gobbledigook" >.git/$prefix/foo && + test_when_finished "rm -f .git/$prefix/foo" && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken + EOF + printf "%s\n" "update $prefix/symref $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err && + cat >expected <<-EOF && + fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken + EOF + printf "%s\n" "update $prefix/symref $D $C" | + test_must_fail git update-ref --stdin 2>output.err && + test_cmp expected output.err +' + +test_expect_success 'no bogus intermediate values during delete' ' + prefix=refs/slow-transaction && + # Set up a reference with differing loose and packed versions: + git update-ref $prefix/foo $C && + git pack-refs --all && + git update-ref $prefix/foo $D && + # Now try to update the reference, but hold the `packed-refs` lock + # for a while to see what happens while the process is blocked: + : >.git/packed-refs.lock && + test_when_finished "rm -f .git/packed-refs.lock" && + { + # Note: the following command is intentionally run in the + # background. We increase the timeout so that `update-ref` + # attempts to acquire the `packed-refs` lock for much longer + # than it takes for us to do the check then delete it: + git -c core.packedrefstimeout=30000 update-ref -d $prefix/foo & + } && + pid2=$! && + # Give update-ref plenty of time to get to the point where it tries + # to lock packed-refs: + sleep 1 && + # Make sure that update-ref did not complete despite the lock: + kill -0 $pid2 && + # Verify that the reference still has its old value: + sha1=$(git rev-parse --verify --quiet $prefix/foo || echo undefined) && + case "$sha1" in + $D) + # This is what we hope for; it means that nothing + # user-visible has changed yet. + : ;; + undefined) + # This is not correct; it means the deletion has happened + # already even though update-ref should not have been + # able to acquire the lock yet. + echo "$prefix/foo deleted prematurely" && + break + ;; + $C) + # This value should never be seen. Probably the loose + # reference has been deleted but the packed reference + # is still there: + echo "$prefix/foo incorrectly observed to be C" && + break + ;; + *) + # WTF? + echo "unexpected value observed for $prefix/foo: $sha1" && + break + ;; + esac >out && + rm -f .git/packed-refs.lock && + wait $pid2 && + test_must_be_empty out && + test_must_fail git rev-parse --verify --quiet $prefix/foo +' + +test_expect_success 'delete fails cleanly if packed-refs file is locked' ' + prefix=refs/locked-packed-refs && + # Set up a reference with differing loose and packed versions: + git update-ref $prefix/foo $C && + git pack-refs --all && + git update-ref $prefix/foo $D && + git for-each-ref $prefix >unchanged && + # Now try to delete it while the `packed-refs` lock is held: + : >.git/packed-refs.lock && + test_when_finished "rm -f .git/packed-refs.lock" && + test_must_fail git update-ref -d $prefix/foo >out 2>err && + git for-each-ref $prefix >actual && + test_grep "Unable to create $SQ.*packed-refs.lock$SQ: " err && + test_cmp unchanged actual +' + +test_expect_success 'delete fails cleanly if packed-refs.new write fails' ' + # Setup and expectations are similar to the test above. + prefix=refs/failed-packed-refs && + git update-ref $prefix/foo $C && + git pack-refs --all && + git update-ref $prefix/foo $D && + git for-each-ref $prefix >unchanged && + # This should not happen in practice, but it is an easy way to get a + # reliable error (we open with create_tempfile(), which uses O_EXCL). + : >.git/packed-refs.new && + test_when_finished "rm -f .git/packed-refs.new" && + test_must_fail git update-ref -d $prefix/foo && + git for-each-ref $prefix >actual && + test_cmp unchanged actual +' + +test_done diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh index 0369beea33b..00b70137053 100755 --- a/t/t1404-update-ref-errors.sh +++ b/t/t1404-update-ref-errors.sh @@ -191,78 +191,6 @@ test_expect_success 'one new ref is a simple prefix of another' ' ' -test_expect_success REFFILES 'empty directory should not fool rev-parse' ' - prefix=refs/e-rev-parse && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - echo "$C" >expected && - git rev-parse $prefix/foo >actual && - test_cmp expected actual -' - -test_expect_success REFFILES 'empty directory should not fool for-each-ref' ' - prefix=refs/e-for-each-ref && - git update-ref $prefix/foo $C && - git for-each-ref $prefix >expected && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - git for-each-ref $prefix >actual && - test_cmp expected actual -' - -test_expect_success REFFILES 'empty directory should not fool create' ' - prefix=refs/e-create && - mkdir -p .git/$prefix/foo/bar/baz && - printf "create %s $C\n" $prefix/foo | - git update-ref --stdin -' - -test_expect_success REFFILES 'empty directory should not fool verify' ' - prefix=refs/e-verify && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - printf "verify %s $C\n" $prefix/foo | - git update-ref --stdin -' - -test_expect_success REFFILES 'empty directory should not fool 1-arg update' ' - prefix=refs/e-update-1 && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - printf "update %s $D\n" $prefix/foo | - git update-ref --stdin -' - -test_expect_success REFFILES 'empty directory should not fool 2-arg update' ' - prefix=refs/e-update-2 && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - printf "update %s $D $C\n" $prefix/foo | - git update-ref --stdin -' - -test_expect_success REFFILES 'empty directory should not fool 0-arg delete' ' - prefix=refs/e-delete-0 && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - printf "delete %s\n" $prefix/foo | - git update-ref --stdin -' - -test_expect_success REFFILES 'empty directory should not fool 1-arg delete' ' - prefix=refs/e-delete-1 && - git update-ref $prefix/foo $C && - git pack-refs --all && - mkdir -p .git/$prefix/foo/bar/baz && - printf "delete %s $C\n" $prefix/foo | - git update-ref --stdin -' - test_expect_success REFFILES 'D/F conflict prevents add long + delete short' ' df_test refs/df-al-ds --add-del foo/bar foo ' @@ -468,169 +396,4 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' ' test_cmp expected output.err ' -test_expect_success REFFILES 'non-empty directory blocks create' ' - prefix=refs/ne-create && - mkdir -p .git/$prefix/foo/bar && - : >.git/$prefix/foo/bar/baz.lock && - test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/foo$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ - EOF - printf "%s\n" "update $prefix/foo $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ - EOF - printf "%s\n" "update $prefix/foo $D $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err -' - -test_expect_success REFFILES 'broken reference blocks create' ' - prefix=refs/broken-create && - mkdir -p .git/$prefix && - echo "gobbledigook" >.git/$prefix/foo && - test_when_finished "rm -f .git/$prefix/foo" && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken - EOF - printf "%s\n" "update $prefix/foo $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/foo$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken - EOF - printf "%s\n" "update $prefix/foo $D $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err -' - -test_expect_success REFFILES 'non-empty directory blocks indirect create' ' - prefix=refs/ne-indirect-create && - git symbolic-ref $prefix/symref $prefix/foo && - mkdir -p .git/$prefix/foo/bar && - : >.git/$prefix/foo/bar/baz.lock && - test_when_finished "rm -f .git/$prefix/foo/bar/baz.lock" && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/symref$SQ: there is a non-empty directory $SQ.git/$prefix/foo$SQ blocking reference $SQ$prefix/foo$SQ - EOF - printf "%s\n" "update $prefix/symref $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ - EOF - printf "%s\n" "update $prefix/symref $D $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err -' - -test_expect_success REFFILES 'broken reference blocks indirect create' ' - prefix=refs/broken-indirect-create && - git symbolic-ref $prefix/symref $prefix/foo && - echo "gobbledigook" >.git/$prefix/foo && - test_when_finished "rm -f .git/$prefix/foo" && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken - EOF - printf "%s\n" "update $prefix/symref $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err && - cat >expected <<-EOF && - fatal: cannot lock ref $SQ$prefix/symref$SQ: unable to resolve reference $SQ$prefix/foo$SQ: reference broken - EOF - printf "%s\n" "update $prefix/symref $D $C" | - test_must_fail git update-ref --stdin 2>output.err && - test_cmp expected output.err -' - -test_expect_success REFFILES 'no bogus intermediate values during delete' ' - prefix=refs/slow-transaction && - # Set up a reference with differing loose and packed versions: - git update-ref $prefix/foo $C && - git pack-refs --all && - git update-ref $prefix/foo $D && - # Now try to update the reference, but hold the `packed-refs` lock - # for a while to see what happens while the process is blocked: - : >.git/packed-refs.lock && - test_when_finished "rm -f .git/packed-refs.lock" && - { - # Note: the following command is intentionally run in the - # background. We increase the timeout so that `update-ref` - # attempts to acquire the `packed-refs` lock for much longer - # than it takes for us to do the check then delete it: - git -c core.packedrefstimeout=30000 update-ref -d $prefix/foo & - } && - pid2=$! && - # Give update-ref plenty of time to get to the point where it tries - # to lock packed-refs: - sleep 1 && - # Make sure that update-ref did not complete despite the lock: - kill -0 $pid2 && - # Verify that the reference still has its old value: - sha1=$(git rev-parse --verify --quiet $prefix/foo || echo undefined) && - case "$sha1" in - $D) - # This is what we hope for; it means that nothing - # user-visible has changed yet. - : ;; - undefined) - # This is not correct; it means the deletion has happened - # already even though update-ref should not have been - # able to acquire the lock yet. - echo "$prefix/foo deleted prematurely" && - break - ;; - $C) - # This value should never be seen. Probably the loose - # reference has been deleted but the packed reference - # is still there: - echo "$prefix/foo incorrectly observed to be C" && - break - ;; - *) - # WTF? - echo "unexpected value observed for $prefix/foo: $sha1" && - break - ;; - esac >out && - rm -f .git/packed-refs.lock && - wait $pid2 && - test_must_be_empty out && - test_must_fail git rev-parse --verify --quiet $prefix/foo -' - -test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' ' - prefix=refs/locked-packed-refs && - # Set up a reference with differing loose and packed versions: - git update-ref $prefix/foo $C && - git pack-refs --all && - git update-ref $prefix/foo $D && - git for-each-ref $prefix >unchanged && - # Now try to delete it while the `packed-refs` lock is held: - : >.git/packed-refs.lock && - test_when_finished "rm -f .git/packed-refs.lock" && - test_must_fail git update-ref -d $prefix/foo >out 2>err && - git for-each-ref $prefix >actual && - test_grep "Unable to create $SQ.*packed-refs.lock$SQ: " err && - test_cmp unchanged actual -' - -test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' ' - # Setup and expectations are similar to the test above. - prefix=refs/failed-packed-refs && - git update-ref $prefix/foo $C && - git pack-refs --all && - git update-ref $prefix/foo $D && - git for-each-ref $prefix >unchanged && - # This should not happen in practice, but it is an easy way to get a - # reliable error (we open with create_tempfile(), which uses O_EXCL). - : >.git/packed-refs.new && - test_when_finished "rm -f .git/packed-refs.new" && - test_must_fail git update-ref -d $prefix/foo && - git for-each-ref $prefix >actual && - test_cmp unchanged actual -' - test_done From patchwork Fri Jan 19 20:18:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524146 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 E067357302 for ; Fri, 19 Jan 2024 20:19:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695549; cv=none; b=p9ZbpTRKFqZ/bkKGyuoHLABtdzdDJ75fq+poSghPJAEl3n+3j0MO5993bCUCMogFA7rDyeSZtX3xhRO56MCnJn8CbpSbe6Hib+H67WIIhFKiGoyte3CyP08aM1O1eGhlTEO+aToDTQDu6ktri3WowU3aobBNrj+tJZ/+ZqGV2PQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695549; c=relaxed/simple; bh=PEtimUn1GkX8AtQ4KhIU36esVMi/OOXPr5jpcmr65zY=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=pPooR8EKtpw11XO5rve1CknoweCwe7FAbFDYc1Cl0nLUKGVtx/RTR/bNGRKaVwPtLbveGyUCsUWP60Lt1FFOs+dgxpWxddJ/8fLPZ7ZUdIJtl1jDUoIq0v3STvnM3HgKjcMSOLIqT9KbpWnnq/+4NEai/3JDahtmMrRKJfQnRmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QXJMYMgV; arc=none smtp.client-ip=209.85.128.51 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="QXJMYMgV" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40e87d07c07so13528985e9.1 for ; Fri, 19 Jan 2024 12:19:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695545; x=1706300345; 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=wvAeKPQ8C29opYWma/beMRAr4IQAGUukuoXbFY7UYso=; b=QXJMYMgVcUkxB9Rcb7PvSI3tOw15uUrQXF9p3Q0m5vM899jA43us/SOVjd4/1unLrZ PXaEbks2BfhE19h+PjmL6tJ8sYy2vZm0KCtDoZ18nc2cAob2lv3tfkTYQ0vdlcjY3+oK CGzSbkSu8AQ5IQXhp0Jvcp/vWUEizv1Ji81kVhcVW3S6coT4UB4TeJ2mujdBvgWT7c98 fnRJdRdyiPwNnTtLoECmzCfkBuJEZetEpaJK/z33W7pmum690rrzsPFUb/b6XRThwCWm u9GeYWFhzY0ZF/1BGFd/oCW4GXud0jXYICjNwv28qeqzlJSuJt4vwXd4jWkQP/NGiV2I 8zpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695545; x=1706300345; 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=wvAeKPQ8C29opYWma/beMRAr4IQAGUukuoXbFY7UYso=; b=q+cu5kuz00daQrG39CTSKFp1tijoR61azaUHtlCoxtdHRaSoMh7PUM4QQu8AZCJ1iG ziUQfrJbyp+C21LJvRSJrOHWeNtk6cGENWDm9vBXXbM7OxggUsUCh0xat5jyJqZ9/D1l HcxbREY4S/Qno57c1g/jOJ6gg+xrh8ky3isRku3Z1Z9wFLhJd8Cf4ckk509W4LXc/VL/ MH3iZmTovDJeOuitqURW/Rp53+55xL0V+7nMXXexBRh2SG7CcekRAX8GyPTHmjyqYNql 2+juYeG4cxKdnhq9hsRWWQVtcJoP4XjsnY/anfGKYNurdFg/dm3nmnhilcOFsIoS1fxx F+uw== X-Gm-Message-State: AOJu0Yw6C2lp3fLLL7ortQeTLRXKTSqXblDWHpSxpp2PV8EJIWUkHhiY UPEjkc6Gv+hsgeSCldUea2N5DIvmoDiTE5uhtGiQ7Vf7C/7digm60GyL14bo X-Google-Smtp-Source: AGHT+IEhKdcLjGMyd/3Q/Us7ibxl4CfZETwIU0i5T7o+8lpDuvcrmOOk8XzTLbd3IrW3al6iEImSYw== X-Received: by 2002:a05:600c:35d3:b0:40e:4df9:8996 with SMTP id r19-20020a05600c35d300b0040e4df98996mr162381wmq.23.1705695545468; Fri, 19 Jan 2024 12:19:05 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n7-20020adff087000000b00337bb0f370dsm7268459wro.40.2024.01.19.12.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:05 -0800 (PST) Message-ID: <42dc9948aa5000e94d63701ef61c9d93a6744b51.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:53 +0000 Subject: [PATCH v2 05/12] t1405: move reffiles specific tests to t0601 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move this test to t0601 with other reffiles specific pack-refs tests since it is reffiles specific in that it looks into the loose refs directory for an assertion. Signed-off-by: John Cai --- t/t0601-reffiles-pack-refs.sh | 8 ++++++++ t/t1405-main-ref-store.sh | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/t/t0601-reffiles-pack-refs.sh b/t/t0601-reffiles-pack-refs.sh index f7a3f693901..2e457c4f2df 100755 --- a/t/t0601-reffiles-pack-refs.sh +++ b/t/t0601-reffiles-pack-refs.sh @@ -32,6 +32,14 @@ test_expect_success 'prepare a trivial repository' ' HEAD=$(git rev-parse --verify HEAD) ' +test_expect_success 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' ' + N=`find .git/refs -type f | wc -l` && + test "$N" != 0 && + test-tool ref-store main pack-refs PACK_REFS_PRUNE,PACK_REFS_ALL && + N=`find .git/refs -type f` && + test -z "$N" +' + SHA1= test_expect_success 'see if git show-ref works as expected' ' diff --git a/t/t1405-main-ref-store.sh b/t/t1405-main-ref-store.sh index 62c1eadb190..976bd71efb5 100755 --- a/t/t1405-main-ref-store.sh +++ b/t/t1405-main-ref-store.sh @@ -15,14 +15,6 @@ test_expect_success 'setup' ' test_commit one ' -test_expect_success REFFILES 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' ' - N=`find .git/refs -type f | wc -l` && - test "$N" != 0 && - $RUN pack-refs PACK_REFS_PRUNE,PACK_REFS_ALL && - N=`find .git/refs -type f` && - test -z "$N" -' - test_expect_success 'create_symref(FOO, refs/heads/main)' ' $RUN create-symref FOO refs/heads/main nothing && echo refs/heads/main >expected && From patchwork Fri Jan 19 20:18:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524148 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 9029557861 for ; Fri, 19 Jan 2024 20:19:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695550; cv=none; b=eQEAPyE9dz6jm3+YqL+4qU9W9adwU0s86PM69jWgs7LtiFKoc9JPvcHIkMTThheGlA7kklH7H2SWsgsiEICLBgB3f828bG9dB6vI394DvCYDpA9O5BlSpRB2Z1wX8zYKYYBGye3VS+L8Rkr0oeGUeZbUGgEHEaxIid6PbT3s1wI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695550; c=relaxed/simple; bh=Nkd1ES8oZVVIlYzuIiljWz/pThveS9EosVP5XK29e6k=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=lj2HGoZPFQz4kBGHDVf0UBF9d9dk/nxV+9A2QRufWYSTmh15m6u90NzAxEoD50CBGx952dNqbxZ1VghIbJTQ3m4HfDxZxjUS6B2dNrKE8rvAhjh0y0ukpiiT2vxSU9qSX/v3PjA817MPRotGH7nQpb5xLiKkZH87MzEVgKK9Yx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bpaM3jYp; arc=none smtp.client-ip=209.85.128.51 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="bpaM3jYp" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso14387805e9.2 for ; Fri, 19 Jan 2024 12:19:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695546; x=1706300346; 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=chiwQS799jM0HodqtY6YZOZUG9U79aDWKtAJKEW1nQY=; b=bpaM3jYpR4UxDqwgJakLxI9IwOUi7n6KutIngTlosmjjdQih6vz6jM8K7tmVvVpNoc ZpZLWqi5bea4kv43mpZqY0FY74xD1ctJQ4hhB/n6Z0BM2BloXplQYB2Geb+qvna+k+PY 5HD+nGjvk+rqLR8MOWwiC6BxvMTPWq7BFY5f402cWCRSMewE0VaX9z7mFd59agCdEXwu Q2B4tV6lUXLVGXfhI8YFjesfczGGzigPYPIE58KTSCeWjzTuIEZw7SdJYcGYdzjaMBKP OMIRtOsJicI8KrqR/yLeThxPoNkxl+742is/vKgjdTrtTAuz6AcLfxcBwcZ5MKpsslS5 FduQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695546; x=1706300346; 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=chiwQS799jM0HodqtY6YZOZUG9U79aDWKtAJKEW1nQY=; b=NYgNY0mEEabADupy7C1+83xqgAbkB3pveTJfb1lWbmnsWgHrF9GiiE6jHjJpilkQge bTbdMsQCJucvvBKSMpDw0V5TxizwzX6HF6XTAw4mT67Y/PUDwt8OE7NtabYTANjfHExM FEm+XD3OfyHshJgaZk1EMuai4p7T2X/dc+J+D5OSFkDdKNLIrsNF6Rd46vEY+fuIL0ti UTVFlk0FMZp/Ykg6GjkTZBjIX+JJE/t4N0TYfLAjZPLSFeG2YyM71qRhrWFOjdGP5peL HDZ770CSm3vhQHxxIdppIpx0sfYM2cgZVuZfMdFGcpaadlKzR7LerA80dof4Wi9RDk+i rabg== X-Gm-Message-State: AOJu0Yx5BSzHiqa4QjLonKW7nQ3MJxLrG4dUr1SJBd3X2knGmNCpLCXc YtS1+WwnIWIdIG+HSgZPbtNbO6OLpo54HVegxTXkr8D6y8XgqHztPAft5c0V X-Google-Smtp-Source: AGHT+IEpXE6IqK8Gce4yH5FckytDUir8O+har8K67E9vo8jQsHEeLHc3FPXxzNyXnAoLxoaf0dx5Vw== X-Received: by 2002:a05:600c:4d97:b0:40e:3529:b874 with SMTP id v23-20020a05600c4d9700b0040e3529b874mr173453wmp.172.1705695546586; Fri, 19 Jan 2024 12:19:06 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id l22-20020a05600c4f1600b0040d6b91efd9sm33819846wmq.44.2024.01.19.12.19.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:05 -0800 (PST) Message-ID: <98e40a024b9ae031d72506ff93684ba1e7efb4ae.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:54 +0000 Subject: [PATCH v2 06/12] t1406: move reffiles specific tests to t0600 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move this test to t0600 with the rest of the tests that are specific to reffiles. This test reaches into reflog directories manually, and so are specific to reffiles. Signed-off-by: John Cai --- t/t0600-reffiles-backend.sh | 48 +++++++++++++++++++++++++++++++++++ t/t1407-worktree-ref-store.sh | 37 --------------------------- 2 files changed, 48 insertions(+), 37 deletions(-) diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh index 2f910bd76ad..3bd28699d53 100755 --- a/t/t0600-reffiles-backend.sh +++ b/t/t0600-reffiles-backend.sh @@ -260,4 +260,52 @@ test_expect_success 'delete fails cleanly if packed-refs.new write fails' ' test_cmp unchanged actual ' +RWT="test-tool ref-store worktree:wt" +RMAIN="test-tool ref-store worktree:main" + +test_expect_success 'setup worktree' ' + test_commit first && + git worktree add -b wt-main wt && + ( + cd wt && + test_commit second + ) +' + +# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should +# only appear in the for-each-reflog output if it is called from the correct +# worktree, which is exercised in this test. This test is poorly written for +# mulitple reasons: 1) it creates invalidly formatted log entres. 2) it uses +# direct FS access for creating the reflogs. 3) PSEUDO-WT and refs/bisect/random +# do not create reflogs by default, so it is not testing a realistic scenario. +test_expect_success 'for_each_reflog()' ' + echo $ZERO_OID > .git/logs/PSEUDO-MAIN && + mkdir -p .git/logs/refs/bisect && + echo $ZERO_OID > .git/logs/refs/bisect/random && + + echo $ZERO_OID > .git/worktrees/wt/logs/PSEUDO-WT && + mkdir -p .git/worktrees/wt/logs/refs/bisect && + echo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random && + + $RWT for-each-reflog | cut -d" " -f 2- | sort >actual && + cat >expected <<-\EOF && + HEAD 0x1 + PSEUDO-WT 0x0 + refs/bisect/wt-random 0x0 + refs/heads/main 0x0 + refs/heads/wt-main 0x0 + EOF + test_cmp expected actual && + + $RMAIN for-each-reflog | cut -d" " -f 2- | sort >actual && + cat >expected <<-\EOF && + HEAD 0x1 + PSEUDO-MAIN 0x0 + refs/bisect/random 0x0 + refs/heads/main 0x0 + refs/heads/wt-main 0x0 + EOF + test_cmp expected actual +' + test_done diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh index 05b1881c591..48b1c92a414 100755 --- a/t/t1407-worktree-ref-store.sh +++ b/t/t1407-worktree-ref-store.sh @@ -53,41 +53,4 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' ' test_cmp expected actual ' -# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should -# only appear in the for-each-reflog output if it is called from the correct -# worktree, which is exercised in this test. This test is poorly written (and -# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly -# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3) -# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is -# not testing a realistic scenario. -test_expect_success REFFILES 'for_each_reflog()' ' - echo $ZERO_OID > .git/logs/PSEUDO-MAIN && - mkdir -p .git/logs/refs/bisect && - echo $ZERO_OID > .git/logs/refs/bisect/random && - - echo $ZERO_OID > .git/worktrees/wt/logs/PSEUDO-WT && - mkdir -p .git/worktrees/wt/logs/refs/bisect && - echo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random && - - $RWT for-each-reflog | cut -d" " -f 2- | sort >actual && - cat >expected <<-\EOF && - HEAD 0x1 - PSEUDO-WT 0x0 - refs/bisect/wt-random 0x0 - refs/heads/main 0x0 - refs/heads/wt-main 0x0 - EOF - test_cmp expected actual && - - $RMAIN for-each-reflog | cut -d" " -f 2- | sort >actual && - cat >expected <<-\EOF && - HEAD 0x1 - PSEUDO-MAIN 0x0 - refs/bisect/random 0x0 - refs/heads/main 0x0 - refs/heads/wt-main 0x0 - EOF - test_cmp expected actual -' - test_done From patchwork Fri Jan 19 20:18:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524149 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 AD3095787F for ; Fri, 19 Jan 2024 20:19:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695551; cv=none; b=leZTc0JBiS7haBp47yiK37dhzVs+HoR2EIjw6dXsYEjttoufVRPn5e0JyLxe4P9i59Ibihr9zGqZtoKXnFTcfS8jX7+HCUoCkKgnFNcwSfE3Swb7n142JZdIkKSiyfGCb2G+IJ8iSEoaKxyMkRIBbBZekec+ibyZ2Tg/RvUHHb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695551; c=relaxed/simple; bh=qlFuWhD1SPvWR5O7I18X5TxShWssvOZe3cDLWitA/RI=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=P+caurcQIVHeQDhM8eatCKlu+Y9RF25bf65PFWtR74i9f7kRm61A94kXRVd1uYkgxbGB/vD/YLklBgvklj0TCoK+IU+AX9yKqqTRZd6HZV8O/CsOK650mQsZGPfwZhReLQTztv+I/0BwvAZ3rECTufW3WFxyBUiAEfgCvqA+jjU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ed9ggALf; arc=none smtp.client-ip=209.85.128.42 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="ed9ggALf" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40e913e3f03so13435155e9.3 for ; Fri, 19 Jan 2024 12:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695547; x=1706300347; 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=5LAoa+8TpL70822AWNODhae4tBNU6PkVIKDUKMrj2Ok=; b=ed9ggALfwJymycnRfTQftYewVeBa/6fVV2b7SXyNtzzlM3ybftUGI9Qg+3Gociv4hw +CebcLs1PMOfAGIYMTaTBxBI9fN1gdMVd5D99l7ZVb4cKe03ZwuBNSlEK8aju8p9HvSb 3meTTwKbGWxi6YNwXRNyrwgx2gKFptAZgNsOYd+CJPYmSIZVPLx91uw6IdFQGeKEtXzl fcsnR5As2c7MleqzyOF9iTdAZWS+cFmhrADeQhhW0RmC3jTYMIjfpu2YfA+KAT0mBSaP wNQTU3CukO8g0tUkKdX7vNKbQzMPfDByfDSRQe8ap0woA26Jo9AdOGUV8gjHiwYiFHMg /Sew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695547; x=1706300347; 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=5LAoa+8TpL70822AWNODhae4tBNU6PkVIKDUKMrj2Ok=; b=bBxgRGsu4rLX0XTOqV9CP6H/fnXF0BLRLETZc7YKVin06x5BQBkvGxmA3AfQnZ1LY2 /7nee3WCUp0sMrfJjwTNl8f/ibmlZNVQsc8wfSw2WWkg/KWqK9VKjwe+X2F4T3dKst7U 5FoZSDy3na/NnQXShFn9yhQasx/KMaTQ2HvdhQ0GZzGYhnWWWrYupD+RZqUYFNUKPsk1 ncyfStZD5Xb8YLNaIJeE0dcBX+83Msjvep3IF5T/nr2hF4UNPUlj2To/jhHz1Vq78vpt KicrM4qckvoxI0bm1vXBFR/BZG4lIrKvzHcPfIKwUHBrJy83bDUEtmTCQ18jPBCJiQZS 0jPg== X-Gm-Message-State: AOJu0Yxp+1OQcRZtzzw5idlqKqKWny8BOHokqjOdKtwiIcRmBqOWwRly l3CNLtrVts+aQo2z6MBcF9NqysfRcsbM+ann71dkhRt+Tkrr4wG4bwfShqkc X-Google-Smtp-Source: AGHT+IGHqquNSUF5H7EDncPhc/KWbcSPuSfAPTPL5i/nX8guTNuNHRaukrH434P1Bi39/QrSE45xQw== X-Received: by 2002:a05:600c:4747:b0:40e:a334:146a with SMTP id w7-20020a05600c474700b0040ea334146amr55865wmo.14.1705695547283; Fri, 19 Jan 2024 12:19:07 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n15-20020a5d4c4f000000b00337d6f0013esm3552683wrt.107.2024.01.19.12.19.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:06 -0800 (PST) Message-ID: In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:55 +0000 Subject: [PATCH v2 07/12] t1410: move reffiles specific tests to t0600 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move these tests to t0600 with other reffiles specific tests since they do things like take a lock on an individual ref, and write directly into the reflog refs Signed-off-by: John Cai --- t/t0600-reffiles-backend.sh | 51 +++++++++++++++++++++++++++++++++++++ t/t1410-reflog.sh | 42 ------------------------------ 2 files changed, 51 insertions(+), 42 deletions(-) diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh index 3bd28699d53..44571033fac 100755 --- a/t/t0600-reffiles-backend.sh +++ b/t/t0600-reffiles-backend.sh @@ -308,4 +308,55 @@ test_expect_success 'for_each_reflog()' ' test_cmp expected actual ' +# Triggering the bug detected by this test requires a newline to fall +# exactly BUFSIZ-1 bytes from the end of the file. We don't know +# what that value is, since it's platform dependent. However, if +# we choose some value N, we also catch any D which divides N evenly +# (since we will read backwards in chunks of D). So we choose 8K, +# which catches glibc (with an 8K BUFSIZ) and *BSD (1K). +# +# Each line is 114 characters, so we need 75 to still have a few before the +# last 8K. The 89-character padding on the final entry lines up our +# newline exactly. +test_expect_success SHA1 'parsing reverse reflogs at BUFSIZ boundaries' ' + git checkout -b reflogskip && + zf=$(test_oid zero_2) && + ident="abc 0000000001 +0000" && + for i in $(test_seq 1 75); do + printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" && + if test $i = 75; then + for j in $(test_seq 1 89); do + printf X || return 1 + done + else + printf X + fi && + printf "\n" || return 1 + done >.git/logs/refs/heads/reflogskip && + git rev-parse reflogskip@{73} >actual && + echo ${zf}03 >expect && + test_cmp expect actual +' + +# This test takes a lock on an individual ref; this is not supported in +# reftable. +test_expect_success 'reflog expire operates on symref not referrent' ' + git branch --create-reflog the_symref && + git branch --create-reflog referrent && + git update-ref referrent HEAD && + git symbolic-ref refs/heads/the_symref refs/heads/referrent && + test_when_finished "rm -f .git/refs/heads/referrent.lock" && + touch .git/refs/heads/referrent.lock && + git reflog expire --expire=all the_symref +' + +test_expect_success 'empty reflog' ' + test_when_finished "rm -rf empty" && + git init empty && + test_commit -C empty A && + >empty/.git/logs/refs/heads/foo && + git -C empty reflog expire --all 2>err && + test_must_be_empty err +' + test_done diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh index a0ff8d51f04..d2f5f42e674 100755 --- a/t/t1410-reflog.sh +++ b/t/t1410-reflog.sh @@ -354,36 +354,6 @@ test_expect_success 'stale dirs do not cause d/f conflicts (reflogs off)' ' test_must_be_empty actual ' -# Triggering the bug detected by this test requires a newline to fall -# exactly BUFSIZ-1 bytes from the end of the file. We don't know -# what that value is, since it's platform dependent. However, if -# we choose some value N, we also catch any D which divides N evenly -# (since we will read backwards in chunks of D). So we choose 8K, -# which catches glibc (with an 8K BUFSIZ) and *BSD (1K). -# -# Each line is 114 characters, so we need 75 to still have a few before the -# last 8K. The 89-character padding on the final entry lines up our -# newline exactly. -test_expect_success REFFILES,SHA1 'parsing reverse reflogs at BUFSIZ boundaries' ' - git checkout -b reflogskip && - zf=$(test_oid zero_2) && - ident="abc 0000000001 +0000" && - for i in $(test_seq 1 75); do - printf "$zf%02d $zf%02d %s\t" $i $(($i+1)) "$ident" && - if test $i = 75; then - for j in $(test_seq 1 89); do - printf X || return 1 - done - else - printf X - fi && - printf "\n" || return 1 - done >.git/logs/refs/heads/reflogskip && - git rev-parse reflogskip@{73} >actual && - echo ${zf}03 >expect && - test_cmp expect actual -' - test_expect_success 'no segfaults for reflog containing non-commit sha1s' ' git update-ref --create-reflog -m "Creating ref" \ refs/tests/tree-in-reflog HEAD && @@ -397,18 +367,6 @@ test_expect_failure 'reflog with non-commit entries displays all entries' ' test_line_count = 3 actual ' -# This test takes a lock on an individual ref; this is not supported in -# reftable. -test_expect_success REFFILES 'reflog expire operates on symref not referrent' ' - git branch --create-reflog the_symref && - git branch --create-reflog referrent && - git update-ref referrent HEAD && - git symbolic-ref refs/heads/the_symref refs/heads/referrent && - test_when_finished "rm -f .git/refs/heads/referrent.lock" && - touch .git/refs/heads/referrent.lock && - git reflog expire --expire=all the_symref -' - test_expect_success 'continue walking past root commits' ' git init orphanage && ( From patchwork Fri Jan 19 20:18:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524150 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 D0C2558100 for ; Fri, 19 Jan 2024 20:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695552; cv=none; b=WBOaYMIsYuSghSBBu816mFHRggllk0sy3z11juCWtpavCvRM4ejbEVjAy2omaMDnMNkxQaVIJ/bV0/ICBVCs2ghGajty99yW/EN1dR4mudGD71ukSIBVCGehWX4/CoUXTgpk8XvP68BBsqbdV5RJaUi2R81iN0tJy6mDdxNBXF4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695552; c=relaxed/simple; bh=QQtvQWkGfG3/B29JvIlcWEHKml9Gd187QvYOiA4Byfs=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=QPynYO2AWUY2ssQNvjLeSn0479q7x/YxyfUFHZ6kOgSlMjIICUqxM4WWJRKApG79Ql9R1YCMIOMowAYSXa4RDsjj2E/kEGK4gI4QjyDpni8H02tx1VYafIWgEuee4/dVFK3WB5ddvMbYFq+k/KJZR7Fn88hDZXmcSXctq1dD0A4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ArSeLgyY; arc=none smtp.client-ip=209.85.221.47 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="ArSeLgyY" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-337d99f9cdfso860095f8f.0 for ; Fri, 19 Jan 2024 12:19:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695548; x=1706300348; 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=IBxrCrz0iGHVRBxhanLHfqFpONMEFYr7FfOvbcRa0u4=; b=ArSeLgyYkOFbpziVL7rXjDeBU2gzhBEj9lvivHDQtMr/tlssqPpW1B9F2gRTpYYjUF fwbA42FjeDixDSbNcGkUfn4AjiDKHtYUjZvx49PgPeaikBJoA63wG1EVvmMJIbHBVqgH HXN7M5zykpmeCFpgeOAY15V38xJ95zmlyYGg7v2q6ahaKEex2gs9buNapJf8uRBHgS4C 6c/GirWxgTpBQ0E00vA4/bYZ3ykVTCtsbUbskthexgEwJgHUa0+dc8xaKjkrtf/oRScS UwCMIGa9anuhyZnT9mlhk8GJ848zXTaOGuTMPrHgeWRUwy7+sg8Aq6M5lzk90wcZoLNj gP9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695548; x=1706300348; 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=IBxrCrz0iGHVRBxhanLHfqFpONMEFYr7FfOvbcRa0u4=; b=f7Xj944IbnL23xTo24f3RLc6ThMlg2s77F4bT78oNseT7TFiX5g4uXGxmwCZqfur7v DsQskN/+jUbVEmZb4S1T+ZyJqw0qymsCbLvXVAHSU74PcvCfa3xSvJko9I5s+rdrAlwm 3MV1PwXedyPqEVGh0zUd7jM/saxORNjcI2tc1a0siTqEv0yx1HOB7Mmd8dIQ7ooR+xC/ ipq7f2PYd2tHqDlJaCCiXtsUYWrPjltCVO04mbFLFQrjNTeI6SxVFjLHFqypPUo3ddge a/Tr2VNixal0Vxh1ui5i85peAR8cc+/jAMp9q3VfPYOkmxWPap2mbsmFKFpj3hDmIZJo nEbg== X-Gm-Message-State: AOJu0YxEG5k4oa6vMSVWRzAFqBjhzGZGZr4gfbJA+R6eFnM0CC29++Zm XbVdW+LhzenlOP5nx9EHcx2FLt15PhwJj7IPSJZOWMWQ8BwgHvRMHXmjh+d1 X-Google-Smtp-Source: AGHT+IGopO8YzhF+BXv1CXv1GTByzTwizExDUOBH6L8DzXdVKekAxEi/DP9Fq/l1nJKuaIUpw9CX8A== X-Received: by 2002:a5d:6383:0:b0:337:c702:98ef with SMTP id p3-20020a5d6383000000b00337c70298efmr116628wru.13.1705695548516; Fri, 19 Jan 2024 12:19:08 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id x8-20020a5d4448000000b0033925e94c89sm249393wrr.12.2024.01.19.12.19.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:07 -0800 (PST) Message-ID: <8327b12a313b00d1ca392f446e13f9c1018f1d84.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:56 +0000 Subject: [PATCH v2 08/12] t1415: move reffiles specific tests to t0601 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move this test into t0601 with other reffiles pack-refs specific tests since it checks for individua loose refs and thus is specific to the reffiles backend. Signed-off-by: John Cai --- t/t0601-reffiles-pack-refs.sh | 20 ++++++++++++++++++++ t/t1415-worktree-refs.sh | 11 ----------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/t/t0601-reffiles-pack-refs.sh b/t/t0601-reffiles-pack-refs.sh index 2e457c4f2df..c2c19befacc 100755 --- a/t/t0601-reffiles-pack-refs.sh +++ b/t/t0601-reffiles-pack-refs.sh @@ -308,4 +308,24 @@ test_expect_success SYMLINKS 'pack symlinked packed-refs' ' test "$(test_readlink .git/packed-refs)" = "my-deviant-packed-refs" ' +# The 'packed-refs' file is stored directly in .git/. This means it is global +# to the repository, and can only contain refs that are shared across all +# worktrees. +test_expect_success 'refs/worktree must not be packed' ' + test_commit initial && + test_commit wt1 && + test_commit wt2 && + git worktree add wt1 wt1 && + git worktree add wt2 wt2 && + git checkout initial && + git update-ref refs/worktree/foo HEAD && + git -C wt1 update-ref refs/worktree/foo HEAD && + git -C wt2 update-ref refs/worktree/foo HEAD && + git pack-refs --all && + test_path_is_missing .git/refs/tags/wt1 && + test_path_is_file .git/refs/worktree/foo && + test_path_is_file .git/worktrees/wt1/refs/worktree/foo && + test_path_is_file .git/worktrees/wt2/refs/worktree/foo +' + test_done diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh index 3b531842dd4..eb4eec8becb 100755 --- a/t/t1415-worktree-refs.sh +++ b/t/t1415-worktree-refs.sh @@ -17,17 +17,6 @@ test_expect_success 'setup' ' git -C wt2 update-ref refs/worktree/foo HEAD ' -# The 'packed-refs' file is stored directly in .git/. This means it is global -# to the repository, and can only contain refs that are shared across all -# worktrees. -test_expect_success REFFILES 'refs/worktree must not be packed' ' - git pack-refs --all && - test_path_is_missing .git/refs/tags/wt1 && - test_path_is_file .git/refs/worktree/foo && - test_path_is_file .git/worktrees/wt1/refs/worktree/foo && - test_path_is_file .git/worktrees/wt2/refs/worktree/foo -' - test_expect_success 'refs/worktree are per-worktree' ' test_cmp_rev worktree/foo initial && ( cd wt1 && test_cmp_rev worktree/foo wt1 ) && From patchwork Fri Jan 19 20:18:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524151 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 B7D945813B for ; Fri, 19 Jan 2024 20:19:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695553; cv=none; b=ZsLWCyPGCI0ZoFOxf0/V2PcSstm/tWdNtfdJfbcT3tp1OU21vVDmv2Jb+PWwcfw63MIpawdALpMpHuuYCXX28JD8SBVbCsUuH6UOONpiliQwXFPUnabmctPgCX+mn0Nf48V1DJEr/DJKlTo5CJwfHqGSxS++1jXIgcgtMzOTThQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695553; c=relaxed/simple; bh=eqPRVhXxl/E6jMHUq2i1l+4r0Gq/CJ/Or14sUkX2W8c=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=c/H8QsTMuJP4I/aD3eF0D0xFc1n0nAfAcs2eDKgi9t40/fP03owCSo30VPinaVGL1XLw4WpKatwtCXjJkcj/FuHTzESD495ji4Sy5Fx0m1rnPKJ4Qy1XRMuhL1RuuWC2zNTYSci4Thf+Hkl/2o6LK2KTyyIiouydxh6IyIBGIDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GDqPEE/X; arc=none smtp.client-ip=209.85.221.46 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="GDqPEE/X" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-337b8da1f49so1001941f8f.0 for ; Fri, 19 Jan 2024 12:19:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695550; x=1706300350; 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=KLS+oY0aUqEObzsza5nrMyjONs2Eyfec2r8jgsx274Y=; b=GDqPEE/XClEMLX+nonmTW5ivkIKnhQdeDhO14wNL+6IMoqhIXQmvGXI0YgPArjDEgV Q6AvqOxO4BsuDIa4yJmIiwQnRz2sF63FdWwBSDJd/gvS0gK1BTjW8K5DWkQGCHELwMeA OWOT4cHdwtMCuUDi3cUUasJp3BkN9Yey5tk+33JC1vCSlviaC1G+cwVUMj3o178MooOi l/G4XxxJAUP9vIV/y6gzn5QCXaX30CSpeeq3+OH1zcKIb7breTTHM9QO0E1u+9yeV+8j Tne1fbh9TElFCAoaYrvl4m2YtHUqEpzGc4nF6Y2bVDWbb4/pKUhM1N8LuzzDJccHz0In /Kfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695550; x=1706300350; 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=KLS+oY0aUqEObzsza5nrMyjONs2Eyfec2r8jgsx274Y=; b=MK7IDP/ktTznUL6cmWOaWMZeU0IRa3+XZj0+7o2P2vkiMrTGrttAP9z3OtHaBqXgG4 n4XeQXycJwvDNDM0FtrzaL43037jNnuGSB7hCEz9jg7w4UQdqoJV2PaINEltGFU1swdv V2nqrl5wTegIkx0rjCJjie0+ALsl+hDoP+mvVhRUXZBES+1PKN2yOEhOLmoH/fN+cVVW W4g/bWYIIJB7o7ceYi0PSIq9TVf8nRp/j1iQHnJv8O2g3vg5W6pmc8jcW7E15PzR+pCY UwGJFA7g/nDAFI99M+/Bf/AFXr6GCr0K33sS5Z2yVkFGUyY+wmp0ji/mNKvD4LnBshPr lT9w== X-Gm-Message-State: AOJu0YxotPhGYF1mmgPekkpjd4ToNVhggQDWVg3ZFm+Nzy5ZIAfrb89C 5vO91dFXE+RYH7dsLE9sJlaDkSPTBUsgKg4FNIMvVA9iUBMQ+Dk9Am9UvuN0 X-Google-Smtp-Source: AGHT+IHoDLLtCWHDxissflGPMDxJ/AuaK6tfj8pRwXRkfJIZQojHjaNiz/Qihdgtt5hSSZJ6RrIEjg== X-Received: by 2002:adf:f811:0:b0:337:d8a6:f674 with SMTP id s17-20020adff811000000b00337d8a6f674mr102131wrp.190.1705695549686; Fri, 19 Jan 2024 12:19:09 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y14-20020adff6ce000000b00337d85a5b0fsm3369154wrp.114.2024.01.19.12.19.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:08 -0800 (PST) Message-ID: <891a3d057d28bd4283a51fe6eb60f1fe99252bb7.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:57 +0000 Subject: [PATCH v2 09/12] t1503: move reffiles specific tests to t0600 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move this test to t0600 with other reffiles specific tests since it checks for loose refs and is specific to the reffiles backend. Signed-off-by: John Cai --- t/t0600-reffiles-backend.sh | 5 +++++ t/t1503-rev-parse-verify.sh | 5 ----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh index 44571033fac..a2ef34eab28 100755 --- a/t/t0600-reffiles-backend.sh +++ b/t/t0600-reffiles-backend.sh @@ -359,4 +359,9 @@ test_expect_success 'empty reflog' ' test_must_be_empty err ' +test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' ' + ln -s does-not-exist .git/refs/heads/broken && + test_must_fail git rev-parse --verify broken +' + test_done diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh index bc136833c10..79df65ec7f6 100755 --- a/t/t1503-rev-parse-verify.sh +++ b/t/t1503-rev-parse-verify.sh @@ -144,11 +144,6 @@ test_expect_success 'main@{n} for various n' ' test_must_fail git rev-parse --verify main@{$Np1} ' -test_expect_success SYMLINKS,REFFILES 'ref resolution not confused by broken symlinks' ' - ln -s does-not-exist .git/refs/heads/broken && - test_must_fail git rev-parse --verify broken -' - test_expect_success 'options can appear after --verify' ' git rev-parse --verify HEAD >expect && git rev-parse --verify -q HEAD >actual && From patchwork Fri Jan 19 20:18:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524152 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 374C658213 for ; Fri, 19 Jan 2024 20:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695553; cv=none; b=nlQ8hv0rzGBi7982oT3vl8YvBGs+w8K7S9gge9kS512wL5XSu3CMWPmAok1WQpSJIhIPwgIjEuPFU8KtS4TziL82QpBfB36KTu0nIj0qUmuHK/3pG9LKwzoHByvdsc/nIlBUBlx5nBxgFJyG/a9HVJQogfpofITyyOhPSMM9gDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695553; c=relaxed/simple; bh=db14RPmpryRtGuOqRKi9W8hZ7Q5YVV3ikOI2sxJ5P1s=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=avCKdiUfzQYIl9BqAVSU976C6QHhnqNGK0SJaNYt64yZ9GCTGX6KsuXnoX2b4V8cltaF5jNkeIc4RpgPI2XtI6MQC/8TBG81vuXM4dwgtjd5APZ3oCH6/gviAVeQMuPC4etfjEuwQLMbGySF6D4HlHr2pjl0rcFAiP8CoPp7kfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OQpNsLZA; arc=none smtp.client-ip=209.85.128.49 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="OQpNsLZA" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-40e775695c6so10446525e9.3 for ; Fri, 19 Jan 2024 12:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695550; x=1706300350; 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=nLLkxfoybHuOVu+BDFTHH7hE8AuqVm0+o3aCaZiM3q4=; b=OQpNsLZA9qPCRleMBA2uKEiW+h4TtYzRpB7VBd8nnkbKoFLSPJtBjWYvCQWUyyQTFy t4MqdWuFjkHZZAI4lDLVWpbsPCJOM6tXq7YtZHSc/5p1DJbRk5ACn0A+xuFMwszppPWV U4+IiYa9sMU42KS5XiEqgONICWnGzZ+63HtYZylxmbN+C8Skuw8O4IXUSAO1wZtAzd6Z zyKhDM68M8385QER1wU7YIGmCc2gLsu8fHdGb44CEaamT59vo2o5q7kcES25nX1Ph9Zt YwaqXezEv98i1+nxb+GcWqFxrBhaLOCm0f4TdGHzN5zLYCt8NATN7xC7/2utDBXFxF5v v48w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695550; x=1706300350; 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=nLLkxfoybHuOVu+BDFTHH7hE8AuqVm0+o3aCaZiM3q4=; b=Or8Rwr2DTlJ4LNomzqHIe/+lPk9t6nbuQuH/LwnmdEGg4zPmBI1owqem7w60NrkT7A 8plOkytS7YwDP3PlfnL7eGg/vTxTIc5jej5mHUqeff/SUn9O87OoQJc5gb4O+dUJTcO3 ySDqax1bWGMvZSbFmKHUPlxV93Xdq7cW17Ievo5YnRu0D7dlZtRIHzXiWU0eNf2Lg7Z7 n2qhxjwmkTjwH80K1kUDkoyfOYkUJeibBPQ4VzwQJ1nyk0mJ8ZZGLuRYHNiTxWBobJQp BbRB59wvJq8L1iM+XhVInqP30FPZKNAGuY34kWXhxwqQZy0Zj+Sf592dezQQ2/ixXFBb ebWA== X-Gm-Message-State: AOJu0Yx5LeErAZe5BCRRvMsscbKbm7EJeZRD8tZ/gwtGStWTGd9ZsXjB Uwpp5KDrbtUJp9DLW7A/o0jpXb3N+FqLZLQMeSXRe3fcPhmO0sMXHHjXwAOQ X-Google-Smtp-Source: AGHT+IFiNFbwjbtz4bjlpOq6ic2SW+k2L/gCe3/K+UhjPSizwntLuvH3WJEPpOqt9ex2krmM5kTTOg== X-Received: by 2002:a05:600c:1e87:b0:40e:4ac1:865e with SMTP id be7-20020a05600c1e8700b0040e4ac1865emr188527wmb.52.1705695550468; Fri, 19 Jan 2024 12:19:10 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id m35-20020a05600c3b2300b0040e541ddcb1sm30317971wms.33.2024.01.19.12.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:10 -0800 (PST) Message-ID: In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:58 +0000 Subject: [PATCH v2 10/12] t3903: make drop stash test ref backend agnostic 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai In this test, the calls to cut(1) are only used to verify that the contents of the reflog entry look as expected. By replacing these with git-reflog(1) calls, we can make this test ref-backend agnostic. Signed-off-by: John Cai --- t/t3903-stash.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 34faeac3f1c..33192405155 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' ' test_cmp expect actual ' -test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' ' +test_expect_success 'drop stash reflog updates refs/stash with rewrite' ' git init repo && ( cd repo && @@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' new_oid="$(git -C repo rev-parse stash@{0})" && cat >expect <<-EOF && - $(test_oid zero) $old_oid - $old_oid $new_oid + $new_oid + $old_oid EOF - cut -d" " -f1-2 repo/.git/logs/refs/stash >actual && + git -C repo reflog show refs/stash --format=%H >actual && test_cmp expect actual && git -C repo stash drop stash@{1} && - cut -d" " -f1-2 repo/.git/logs/refs/stash >actual && + git -C repo reflog show refs/stash --format=%H >actual && cat >expect <<-EOF && - $(test_oid zero) $new_oid + $new_oid EOF test_cmp expect actual ' From patchwork Fri Jan 19 20:18:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524153 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 6B31C58231 for ; Fri, 19 Jan 2024 20:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695555; cv=none; b=t5uCLeKbUgvnP1M7+addBhn3Ykqsmx0v+sNNYnDMz04pK5Orxe3fy8NL7pkvAGtad74Eoif984qAVs4yG0BAt217h5w0rSDt9RsLBYTYs80M71uAlNxl77rW2icMhQQ4bUKx7RxuR9DKJ+XhJBpbDWTdOpbT8g71UWhYvuJ3Fno= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695555; c=relaxed/simple; bh=0BNqy62I21DufwdVTrJXJjFfhrTvm0QQSsq7wxShHek=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=Nm//soMHHHeWr3s8fguHazut0snBskSMwACwaStbdmBQKTkXP5hk6fOGBbIRwjdWh/mmeKr15po+Mqfi7dCEZuWm4yM60Ck6KhtbpwE50mypFkw0Z+21oDDIXEJY+uKKlmhvRcztXXQ3pCCbsq1vz6l6PCpR3w5bnlZPwU/Za0s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GBB8fA5B; arc=none smtp.client-ip=209.85.128.44 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="GBB8fA5B" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40e884ac5c8so12822655e9.2 for ; Fri, 19 Jan 2024 12:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695551; x=1706300351; 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=KZcL5wFS2YZ9ArnfVnbXUSI+bxzKkx1bzGbtQ1tm0aA=; b=GBB8fA5Bus3JELeTiaj/fpHaviUUXAogRVRqHR9Ju8VfGVXwtkrQsAY5WjuyDpbX9I 42yDeCtTggqNeacnZF+lOCCNUPgG60gCYhyjBtvjYdTronhdERopbdZ9nRP5K2Y42Mwz ZGbET2B9/Tm98JWwWhgCr9kz2WwRk49LUTR0pK0M6zE9b/M0mRZJkAeGR65nQqG+mCSu IimDcflAxkz8+zMO5fOkPGWNibwN1jn4DBub6bsGb+sS/9uIAwqu2kFRKxF/n9YJxROf HDBpHf62wIg1IFZf5WQtuymdVmbs4qtwnKjYh5zcA3dA6ehOBVJOWShL5o0HDGbV5rkY R+Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695551; x=1706300351; 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=KZcL5wFS2YZ9ArnfVnbXUSI+bxzKkx1bzGbtQ1tm0aA=; b=Yd7bnEHvf7FIAdvocLZo8yr/fW5ytv99ImJ3Ykdv3DlLZO5vcSc686gkNhN8cYfngC 7V2kBAjaLkfubMwBkottPKLj7IYhe/YfTj9PN6uMbUO7YEZzXpcZBuSN6/J5Zd0H8ELh cgOdTb3+HLq08Rgq11Ej7Pmya/UdZ1yM/4nk2zwJg6Fq6tLlqPepxKDYk62ALmjmsXjy ulAz/vWHRn9MnYWeOjgiRoGSAFVk7XAJVNfi+ZczEKL9wL64F/3Smjl0tzDF5tJBLncr uVbIEyYsJ1CQhSODmOCSyoWQXD9HxUFJbh2OL2TsgxLCUOhOJEhDI2RNahDHu5wadMmj 23Fg== X-Gm-Message-State: AOJu0YzMY/zRK8GXTux5JosbgN/zpIImSKR4bMsxLFbqwPfSD2dK86Gx klqOCsGFnpDI4c28K4hyKxsyb9lNfNWHRFtRM06AKQJ3toQbud98R6yIce1R X-Google-Smtp-Source: AGHT+IFkzinLKChfqsMUjI6VGiuW9lC/mM7Hm4pIUVx+3oiEnDqeJFNx7zbRVezLTEnSKI0CsI+g0g== X-Received: by 2002:a05:600c:3217:b0:40e:5947:bcc7 with SMTP id r23-20020a05600c321700b0040e5947bcc7mr92775wmp.174.1705695551110; Fri, 19 Jan 2024 12:19:11 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i4-20020a5d5224000000b003374555d88esm7275240wra.56.2024.01.19.12.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:10 -0800 (PST) Message-ID: <976be7efc89ae39194b06d12989c30f849854516.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:18:59 +0000 Subject: [PATCH v2 11/12] t4202: move reffiles specific tests to t0600 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move two tests into t0600 since they write loose reflog refs manually and thus are specific to the reffiles backend. Signed-off-by: John Cai --- t/t0600-reffiles-backend.sh | 17 +++++++++++++++++ t/t4202-log.sh | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/t/t0600-reffiles-backend.sh b/t/t0600-reffiles-backend.sh index a2ef34eab28..17ff60dde77 100755 --- a/t/t0600-reffiles-backend.sh +++ b/t/t0600-reffiles-backend.sh @@ -364,4 +364,21 @@ test_expect_success SYMLINKS 'ref resolution not confused by broken symlinks' ' test_must_fail git rev-parse --verify broken ' +test_expect_success 'log diagnoses bogus HEAD hash' ' + git init empty && + test_when_finished "rm -rf empty" && + echo 1234abcd >empty/.git/refs/heads/main && + test_must_fail git -C empty log 2>stderr && + test_grep broken stderr +' + +test_expect_success 'log diagnoses bogus HEAD symref' ' + git init empty && + test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock && + test_must_fail git -C empty log 2>stderr && + test_grep broken stderr && + test_must_fail git -C empty log --default totally-bogus 2>stderr && + test_grep broken stderr +' + test_done diff --git a/t/t4202-log.sh b/t/t4202-log.sh index ddd205f98ab..60fe60d7610 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -2255,23 +2255,6 @@ test_expect_success 'log on empty repo fails' ' test_grep does.not.have.any.commits stderr ' -test_expect_success REFFILES 'log diagnoses bogus HEAD hash' ' - git init empty && - test_when_finished "rm -rf empty" && - echo 1234abcd >empty/.git/refs/heads/main && - test_must_fail git -C empty log 2>stderr && - test_grep broken stderr -' - -test_expect_success REFFILES 'log diagnoses bogus HEAD symref' ' - git init empty && - test-tool -C empty ref-store main create-symref HEAD refs/heads/invalid.lock && - test_must_fail git -C empty log 2>stderr && - test_grep broken stderr && - test_must_fail git -C empty log --default totally-bogus 2>stderr && - test_grep broken stderr -' - test_expect_success 'log does not default to HEAD when rev input is given' ' git log --branches=does-not-exist >actual && test_must_be_empty actual From patchwork Fri Jan 19 20:19:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Cai X-Patchwork-Id: 13524154 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (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 28B2158AA8 for ; Fri, 19 Jan 2024 20:19:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695555; cv=none; b=KcOVLdG5PvaHzeLBzSkkIPJv8L1H5/jVM5cyfL9N0XhjIPRYoKuWgYycX9gvy9Srawc2gWxxy7+7GE7BBTkN9SHTfkHNSL1GyeWMGyA1RZkxF9Ipiob69OphCbOmGImdJZ718IqVim5g9j14glKED8O49H9gVnZk2zUz1biPsXs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705695555; c=relaxed/simple; bh=ejqNHH5KjAGEhLO2wXgrqJb7tXVf68mEg1yp5eJbapk=; h=Message-ID:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=rlg95Ijcjw1Keto7xxsxvRzCFhZXPC2xgpHAmaGeEl4aaGOK6fgj2YHLe+wgtKUfD2hS2OnAdrQPQd8bEpoXk7WtzKF5UrZbjTwBHwUloYQdAidc2J3xHXRwj92F7VQ+BTzppVPy1kTkFnYOYDklVeS70zJpQUHCHdhklJzwsJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PQ2irkrd; arc=none smtp.client-ip=209.85.221.42 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="PQ2irkrd" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-338aca547d9so847163f8f.0 for ; Fri, 19 Jan 2024 12:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705695552; x=1706300352; 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=EvaBrntQ+N1TnDrJtNuUCqAW79T8hXzXkq3CXl/qwHQ=; b=PQ2irkrdcgGVE8ZuNoJbERYwdGirWfHp1wpcOb9vnte/cglzBH780Ra7PjuyWmQZSw hqZKy7d8mx+LCaGPgwldYPo6R0qq31qbFLU+/tc8mZGDoJw8dbSvVDfSKq/h8fOxL7d1 iQFcO8pSLiokdZ9v9aRCnsDWS/yFZaVdSO+KGkMgYA8mVWKCyLHiYUHYT5+kbgQIkif2 +bo1KuyiLOsHqOWQeqAUN/Qt7MPiP4WqYOt1Qx3pT36y472JJGqErGC+gaPa3tBKwa4q d9p67FQSWkCVssmAJFZhC6JnJGNf1huBIJ8aDI1J49jPNZF5H10cdQhXxYdpurqaXsT6 QeSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705695552; x=1706300352; 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=EvaBrntQ+N1TnDrJtNuUCqAW79T8hXzXkq3CXl/qwHQ=; b=kt2k6NKK+13SUxXNQk3NiuLJE64OeE70pJ+H9YUJVeV5BzSSdj1ywfYFXs3hjWZ2qB RselpqSwCoUsPGpHcr+2YS8pNy7KTWX3/Zc3M3RRk8ArvRMlxexw7WPKuscpCjU5RB2j 6GQ93km5nlycpe2tsaloAzeIrsUKOMNay4QLniiDb+z8suYjL0BjbAdWi9+43L0RMerQ pM6XKfwQ3s/Cl7+xYdHdrxdx8LdigmBCrzPWzILvsF4hkrejcKK3F2SaIDJd2rF58EIa z1VF4zY83jOtir2xAtH80jtQzBBJ3pofX+2jHjuwCT84YZ/Cf0FagzMnm78zkGgjINTk BeDw== X-Gm-Message-State: AOJu0Yx+/NlfKfysyCHVcewlX3L9zgRKS2pQHeGZXgdgTQiUKMRGTyJS Wlbf84OAgF27GRnA3TTyQ991MbrNQzEFVwo67srF40FFqxJmxepM4umQG8A+ X-Google-Smtp-Source: AGHT+IH5Yi6eX88Oaabf9zv+t1EtG8H3aNLuxRr+rTVKHiqrPsFRDAsNocpCHTPJYN27FeEWfDke7A== X-Received: by 2002:a5d:5f8b:0:b0:337:eec:62e3 with SMTP id dr11-20020a5d5f8b000000b003370eec62e3mr88947wrb.17.1705695552147; Fri, 19 Jan 2024 12:19:12 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id w6-20020adfee46000000b00337cf4a20c6sm4661425wro.31.2024.01.19.12.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 12:19:11 -0800 (PST) Message-ID: <7329e87148a7f8d4f8bd1b0fd3a0b1e0bc9e9e69.1705695540.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Fri, 19 Jan 2024 20:19:00 +0000 Subject: [PATCH v2 12/12] t5312: move reffiles specific tests to t0601 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: Patrick Steinhardt , John Cai , John Cai From: John Cai From: John Cai Move a few tests into t0601 since they specifically test the packed-refs file and thus are specific to the reffiles backend. Signed-off-by: John Cai --- t/t0601-reffiles-pack-refs.sh | 30 ++++++++++++++++++++++++++++++ t/t5312-prune-corruption.sh | 26 -------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) diff --git a/t/t0601-reffiles-pack-refs.sh b/t/t0601-reffiles-pack-refs.sh index c2c19befacc..263e99cd84b 100755 --- a/t/t0601-reffiles-pack-refs.sh +++ b/t/t0601-reffiles-pack-refs.sh @@ -328,4 +328,34 @@ test_expect_success 'refs/worktree must not be packed' ' test_path_is_file .git/worktrees/wt2/refs/worktree/foo ' +# we do not want to count on running pack-refs to +# actually pack it, as it is perfectly reasonable to +# skip processing a broken ref +test_expect_success 'create packed-refs file with broken ref' ' + test_tick && git commit --allow-empty -m one && + recoverable=$(git rev-parse HEAD) && + test_tick && git commit --allow-empty -m two && + missing=$(git rev-parse HEAD) && + rm -f .git/refs/heads/main && + cat >.git/packed-refs <<-EOF && + $missing refs/heads/main + $recoverable refs/heads/other + EOF + echo $missing >expect && + git rev-parse refs/heads/main >actual && + test_cmp expect actual +' + +test_expect_success 'pack-refs does not silently delete broken packed ref' ' + git pack-refs --all --prune && + git rev-parse refs/heads/main >actual && + test_cmp expect actual +' + +test_expect_success 'pack-refs does not drop broken refs during deletion' ' + git update-ref -d refs/heads/other && + git rev-parse refs/heads/main >actual && + test_cmp expect actual +' + test_done diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh index 230cb387122..d8d2e304687 100755 --- a/t/t5312-prune-corruption.sh +++ b/t/t5312-prune-corruption.sh @@ -111,30 +111,4 @@ test_expect_success 'pack-refs does not silently delete broken loose ref' ' test_cmp expect actual ' -# we do not want to count on running pack-refs to -# actually pack it, as it is perfectly reasonable to -# skip processing a broken ref -test_expect_success REFFILES 'create packed-refs file with broken ref' ' - rm -f .git/refs/heads/main && - cat >.git/packed-refs <<-EOF && - $missing refs/heads/main - $recoverable refs/heads/other - EOF - echo $missing >expect && - git rev-parse refs/heads/main >actual && - test_cmp expect actual -' - -test_expect_success REFFILES 'pack-refs does not silently delete broken packed ref' ' - git pack-refs --all --prune && - git rev-parse refs/heads/main >actual && - test_cmp expect actual -' - -test_expect_success REFFILES 'pack-refs does not drop broken refs during deletion' ' - git update-ref -d refs/heads/other && - git rev-parse refs/heads/main >actual && - test_cmp expect actual -' - test_done