public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix shallow clone with ref-in-want enabled
@ 2025-12-24  0:35 Matthew Dodd
  2025-12-24  0:35 ` [PATCH 1/2] upload-pack: send shallow-info before wanted-refs in protocol v2 Matthew Dodd
  2025-12-24  0:35 ` [PATCH 2/2] t5703: add test for shallow fetch with ref-in-want Matthew Dodd
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Dodd @ 2025-12-24  0:35 UTC (permalink / raw)
  To: git; +Cc: Brandon Williams, Junio C Hamano, Johannes Schindelin, Mats-Dodd

From: Mats-Dodd <mats.dodd12@gmail•com>

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
-- 
2.47.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-05 13:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 2/2] t5703: add test for shallow fetch with ref-in-want Matthew Dodd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox