Re: [PATCH v3 11/11] http-fetch: Use temporary files for pack-*.idx until verified
- From
Tay Ray Chuan <rctay89@gmail.com>
- Date
- Apr 18, 2010, 03:57 UTC
- 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" <spearce@spearce.org> 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]
Show 5 quoted lines
> - if (has_pack_index(sha1)) {
> - ret = 0;
> - goto cleanup;
> - }
> --- Cheers, Ray Chuan