Re: git fetch over http:// left my repo broken
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Apr 15, 2010, 14:15 UTC
- Message-ID
- <20100415141504.GB17883@spearce.org>
- In-Reply-To
- <20100415114319.GA28326@LK-Perkele-V2.elisa-laajakaista.fi>
Ilari Liusvaara <ilari.liusvaara@elisanet.fi> wrote:
Show 11 quoted lines
> On Thu, Apr 15, 2010 at 11:58:27AM +0200, Michael J Gruber wrote: > > Christian Halstrick venit, vidit, dixit 15.04.2010 11:51: > > > > But still, Git should be able to deal with broken servers. The problem > > is: If the server does not report any problem but simply serves a broken > > pack (with correct header), how should Git notice? It would require a > > fsck before accepting any new pack. > > Pack trailer hash. Apparently dumb HTTP fetch needs to bypass pack to index > conversion somehow since index-pack aborts if trailer hash check fails (not > to mention other failures corrupt pack may cause).
Oddly enough, http.c runs verify_pack() after the download, but does so only after it swings the pack file into position. If verify_pack() fails, it leaves the corrupt pack file in the objects/pack directory. Talk about fail.
I'll put together a patch shortly.
-- Shawn.