]> git.ipfire.org Git - thirdparty/git.git/commit
http: accept HTTP 416 for complete partial packs
authorTed Nyman <tnyman@openai.com>
Mon, 27 Jul 2026 00:28:40 +0000 (17:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jul 2026 19:57:20 +0000 (12:57 -0700)
commit85f4f04f820c9aa6cfdfb4594ceb9b41515a8245
tree8b7b7165c7f3cd6b4e273e3a6abc69ba4d13b63e
parentf0d866a2eafcd012fb8fda8edd6b32da68859d7b
http: accept HTTP 416 for complete partial packs

A resumed pack request may already have all bytes of the remote pack.
A server can respond to the resulting Range request with HTTP 416
instead of returning an empty response.

Accept that response in each pack-download caller and let index-pack
validate the completed staging file. This can happen without concurrent
downloads when a previous attempt completed the transfer but failed
before indexing it.

Add a regression test that seeds a complete partial pack and checks that
http-fetch indexes it after the server returns HTTP 416.

Signed-off-by: Ted Nyman <tnyman@openai.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http-fetch.c
http-push.c
http-walker.c
t/t5550-http-fetch-dumb.sh