git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG?] remote-http: interrupted fetch leaves bad index behind

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Feb 4, 2011, 01:09 UTC
Message-ID
<20110204010957.GB17483@elie>
In-Reply-To
<20101105170640.30975.94952.reportbug@deb0>
Hi gitsters,
Török Edwin wrote[1]:
Show 7 quoted 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 find 72128861501dc742d33e88b473482e17f6672d4c under http://git.clamav.net/clamav-devel.git
> Cannot obtain needed object 72128861501dc742d33e88b473482e17f6672d4c
> 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]

diff --git a/remote-curl.c b/remote-curl.c
index 04d4813..b0ad1aa 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -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);
 }
 
Message 1 of 1 in “[BUG?] remote-http: interrupted fetch leaves bad index behind”
  1. Jonathan NiederFeb 4, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.