Subject: Re: [PATCH v3 11/11] http-fetch: Use temporary files for pack-*.idx until verified

From: Tay Ray Chuan <[email-masked]>
Date: Sun, 18 Apr 2010 11:57:44 +0800

Hi,

On Sat, 17 Apr 2010 13:07:44 -0700
"Shawn O. Pearce" <[email-masked]> wrote:

> Verify that a downloaded pack-*.idx file is consistent and valid
> as an index file before we rename it into its final destination.
> This prevents a corrupt index file from later being treated as a
> usable file, confusing readers.

Perhaps this should be added in:

  Check that we do not have the pack index file before invoking
  fetch_and_setup_pack_index(); that way, we can do without the
  has_pack_index() check in fetch_and_setup_pack_index().

The above was referring to this hunk:

> diff --git a/http.c b/http.c
[snip]
> -	if (has_pack_index(sha1)) {
> -		ret = 0;
> -		goto cleanup;
> -	}
> -

-- 
Cheers,
Ray Chuan