Skip to content

Fix shallow clone with ref-in-want enabled

Matthew Dodd git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2upload-pack: send shallow-info before wanted-refs in protocol v2upload-pack.c+1 -11 reply
2/2t5703: add test for shallow fetch with ref-in-wantt/t5703-upload-pack-ref-in-want.sh+9 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Fix shallow clone with ref-in-want enabled

From: Mats-Dodd <[email protected]>

The ref-in-want feature (uploadpack.allowRefInWant) has been broken with shallow clones since it was introduced in 516e2b76bdc (upload-pack:
implement ref-in-want, 2018-06-27). When enabled, shallow clones fail with:

fatal: expected 'packfile', received 'shallow-info'

The server sends protocol v2 sections in the wrong order, violating the specification in Documentation/gitprotocol-v2.adoc and client expectations in fetch-pack.c.

This series:
1. Fixes the section ordering in upload-pack.c (swap two lines)
2. Adds a regression test for shallow clone + ref-in-want

Mats-Dodd (2):
upload-pack: send shallow-info before wanted-refs in protocol v2
t5703: add test for shallow fetch with ref-in-want

 t/t5703-upload-pack-ref-in-want.sh | 9 +++++++++
 upload-pack.c                      | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

base-commit: 9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed

Signature · 1 line
2.47.0