git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MDMatthew Dodd <mats.dodd12@gmail.com>
Date
Dec 24, 2025, 00:35 UTC
Message-ID
<20251224003504.52660-1-mats.dodd12@gmail.com>
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
Next: Matthew Dodd
Message 1 of 4 in “Fix shallow clone with ref-in-want enabled”
  1. 0/2 Fix shallow clone with ref-in-want enabledMatthew Dodd, Dec 24, 2025
  2. 1/2 upload-pack: send shallow-info before wanted-refs in protocol v2Matthew Dodd, Dec 24, 2025
  3. Patrick SteinhardtJan 5, 2026
  4. 2/2 t5703: add test for shallow fetch with ref-in-wantMatthew Dodd, Dec 24, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.