From: Matthew Dodd <mats.dodd12@gmail•com>
To: git@vger•kernel.org
Cc: Brandon Williams <bmwill@google•com>,
Junio C Hamano <gitster@pobox•com>,
Johannes Schindelin <Johannes.Schindelin@gmx•de>,
Mats-Dodd <mats.dodd12@gmail•com>
Subject: [PATCH 2/2] t5703: add test for shallow fetch with ref-in-want
Date: Wed, 24 Dec 2025 01:35:04 +0100 [thread overview]
Message-ID: <20251224003504.52660-3-mats.dodd12@gmail.com> (raw)
In-Reply-To: <20251224003504.52660-1-mats.dodd12@gmail.com>
From: Mats-Dodd <mats.dodd12@gmail•com>
Add a regression test for shallow clone operations when the server has
uploadpack.allowRefInWant enabled. Before the previous commit, this
operation would fail with:
fatal: expected 'packfile', received 'shallow-info'
This was due to the server sending protocol v2 sections in the wrong
order. The test ensures this scenario continues to work.
Signed-off-by: Mats-Dodd <mats.dodd12@gmail•com>
---
t/t5703-upload-pack-ref-in-want.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 249137b467..21f4049eb4 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -256,6 +256,15 @@ test_expect_success 'fetching multiple refs' '
grep "want-ref refs/heads/baz" log
'
+test_expect_success 'fetching with ref-in-want and shallow' '
+ rm -rf local &&
+ git -c protocol.version=2 clone --depth=1 "file://$REPO" local &&
+
+ git -C "$REPO" rev-parse main >expected &&
+ git -C local rev-parse refs/remotes/origin/main >actual &&
+ test_cmp expected actual
+'
+
test_expect_success 'fetching ref and exact OID' '
test_when_finished "rm -f log" &&
--
2.47.0
prev parent reply other threads:[~2025-12-24 0:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-24 0:35 [PATCH 0/2] Fix shallow clone with ref-in-want enabled Matthew Dodd
2025-12-24 0:35 ` [PATCH 1/2] upload-pack: send shallow-info before wanted-refs in protocol v2 Matthew Dodd
2026-01-05 13:00 ` Patrick Steinhardt
2025-12-24 0:35 ` Matthew Dodd [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251224003504.52660-3-mats.dodd12@gmail.com \
--to=mats.dodd12@gmail$(echo .)com \
--cc=Johannes.Schindelin@gmx$(echo .)de \
--cc=bmwill@google$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox