[PATCH 2/2] t5703: add test for shallow fetch with ref-in-want
- From
- Matthew Dodd <mats.dodd12@gmail.com>
- Date
- Dec 24, 2025, 00:35 UTC
- Message-ID
- <20251224003504.52660-3-mats.dodd12@gmail.com>
- 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