From: Tay Ray Chuan Date: Sun, 18 Apr 2010 03:57:44 GMT Subject: Re: [PATCH v3 11/11] http-fetch: Use temporary files for pack-*.idx until verified Message-ID: <20100418115744.0000238b@unknown> In-Reply-To: <1271534864-31944-11-git-send-email-spearce@spearce.org> Hi, On Sat, 17 Apr 2010 13:07:44 -0700 "Shawn O. Pearce" 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