Skip to content

Conversation

@jelmer
Copy link
Owner

@jelmer jelmer commented Jul 13, 2025

No description provided.

stspdotname and others added 3 commits July 13, 2025 11:17
…ened

This test shows that deepening shallow clones works across all Git protocol
versions. The trick to make this work is to pass depth=DEPTH_INFINITE

Related to issue #1399
When fetching from a shallow clone with depth=DEPTH_INFINITE over HTTP,
the client would fail with "unknown command" error. This happened because:

1. The HTTP client defers reading shallow updates until after the request
2. It unconditionally tries to read shallow updates when new_shallow is None
3. But the server may not send any shallow updates, causing _read_shallow_updates
   to try parsing regular protocol data (ACK/NAK) as shallow commands

The fix checks if the first packet is actually a shallow/unshallow command
before attempting to read shallow updates. If not, it assumes no shallow
updates were sent and continues with normal protocol handling.

Fixes issue when deepening a shallow clone to full depth over HTTP.
@jelmer jelmer force-pushed the shallow-clone-fix branch from 0dea09d to 704e4ea Compare July 13, 2025 11:08
@jelmer jelmer marked this pull request as ready for review July 13, 2025 11:08
@jelmer jelmer enabled auto-merge July 13, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants