Subject: Re: [PATCH v3 10/11] http-fetch: Use index-pack rather than verify-pack to check packs

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

Hi,

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

> diff --git a/http.c b/http.c
> index 9f3dfc1..a7352b7 100644
> --- a/http.c
> +++ b/http.c
[snip]
> @@ -998,11 +999,15 @@ void release_http_pack_request(struct http_pack_request *preq)
>  
>  int finish_http_pack_request(struct http_pack_request *preq)
>  {
[snip]
> +	unlink(sha1_pack_index_name(p->sha1));

I think this should be done later, after we have run index-pack
successfully. A good place would be probably after the if() block here:

> +	if (run_command(&ip)) {
> +		unlink(preq->tmpfile);
> +		unlink(tmp_idx);
> +		free(tmp_idx);
>  		return -1;
> -	install_packed_git(p);
> +	}

-- 
Cheers,
Ray Chuan