Skip to content

Fix empty SHA-256 clones with v0 and v1

brian m. carlson git 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest1 patch 4 repliesIn review
  2. v21 patch 3 repliesSuperseded
  3. v12 patches 21 repliesSuperseded

Changes in v3 from the cover letter

* Move advertisement of fake capabilities ref to a separate function to avoid an extra strcmp.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1upload-pack: advertise capabilities when cloning empty repost/t5551-http-fetch-smart.sh t/t5700-protocol-v1.sh upload-pack.c+73 -70 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/1] Fix empty SHA-256 clones with v0 and v1

We recently fixed empty clones with SHA-256 over protocol v2 by honouring the hash algorithm specified even when no refs are present. However, in doing so, we made it impossible to set up a v0 or v1 repository by cloning from an empty SHA-256 repository. In doing so, we also broke the Git LFS testsuite for SHA-256 repositories.

This series introduces the dummy capabilities^{} entry for fetches and clones from an empty repository for v0 and v1, just as we do for clones. This is already supported by older versions of Git, as well as libgit2, dulwich, and JGit.

Changes since v2:
* Move advertisement of fake capabilities ref to a separate function to avoid an extra strcmp.

Changes since v1:
* Drop patch to honour GIT_DEFAULT_HASH
* Support all requests, not just HTTP.
* Add more tests.
* Fix NULL pointer dereference.

brian m. carlson (1):
upload-pack: advertise capabilities when cloning empty repos

 t/t5551-http-fetch-smart.sh | 27 +++++++++++++++++++++++++++
 t/t5700-protocol-v1.sh      | 31 +++++++++++++++++++++++++++++--
 upload-pack.c               | 22 +++++++++++++++++-----
 3 files changed, 73 insertions(+), 7 deletions(-)