Re: Cloning from sites with 404 overridden
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:22
"Marco Costalba" [off-list ref] writes:
Perhaps I am proposing a total idiocy, I don't know git-fetch internals, but wouldn't be better to avoid trying to download a non existing object? So to fix the problem at the origin? I don't know if it is possible to list contents before try to download so to avoid asking for a non existing object.
There is no way for the downloader to know if the upstream repository has packed which object. What is happening is that the commit walker asks for loose object first because it does not know. Upon getting a "no such file" (or in the case of misconfigured HTTP server that does not say 404, "corrupt object"), it then checks if the object appears in the pack by downloading the pack index. It can tell what objects are in the packs by looking at the pack index and downloads the pack that contains needed object.