remote-http: interrupted fetch leaves bad index behind
A message that is not in the archive (sent off-list or not yet received): 20101105170640.30975.94952.reportbug@deb0
Hi gitsters,
Török Edwin wrote[1]:
Quoted 7 lines
If I run 'git remote update' when the remote is an http URL, and then I Ctrl-C in the middle of a pack download, I get the .idx and .pack.temp.
Next time when I run 'git remote update' it tells me it can't find some refs:
error: Unable to find72128861501dc742d33e88b473482e17f6672d4cunder http://git.clamav.net/clamav-devel.git
Cannot obtain needed object72128861501dc742d33e88b473482e17f6672d4c
error: Fetch failed.
Steps to reproduce:
1. Disable smart HTTP[2].
2.
git init reproduce
cd reproduce
git remote add clam http://git.clamav.net/clamav-devel.git
3. git fetch clam
Wait a few seconds (there will be no output). Hit ^C.
$ ls .git/objects/pack/ pack-98c82c9d2da21d2efddc4544d68332235795df19.idx.temp.temp $ git fetch clam error: wrong index v2 file size in .git/objects/pack/pack-98c82c9d2da21d2efddc4544d68332235795df19.idx.temp error: Unable to find fe96c524670f23f73008c0e6b4001c096e4f9532 under http://git.clamav.net/clamav-devel.git Cannot obtain needed object fe96c524670f23f73008c0e6b4001c096e4f9532 error: Fetch failed.
Ideas?
Jonathan
[1] http://bugs.debian.org/602528
[2]
remote-curl.c +2 -0
@@ -625,10 +625,12 @@ static int fetch_git(struct discovery *heads,static int fetch (int nr_heads,struct ref **to_fetch) { +#if 0 struct discovery *d =discover_refs ("git-upload-pack" );if (d->proto_git)return fetch_git (d, nr_heads, to_fetch); else +#endif return fetch_dumb (nr_heads, to_fetch); }