Subject: Re: [PATCH v2 01/25] remote-curl.c: convert fetch_git() to use argv_array

From: Junio C Hamano <[email-masked]>
Date: Thu, 04 Feb 2016 14:59:38 -0800

Nguyễn Thái Ngọc Duy  <[email-masked]> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>

Yay, it's about time ;-)

> diff --git a/remote-curl.c b/remote-curl.c
> index c704857..3ac5b6c 100644
> --- a/remote-curl.c
> +++ b/remote-curl.c
> @@ -726,37 +726,31 @@ static int fetch_git(struct discovery *heads,
>  	struct rpc_state rpc;
>  	struct strbuf preamble = STRBUF_INIT;
>  	char *depth_arg = NULL;
> -	int argc = 0, i, err;
> -	const char *argv[17];
> +	int i, err;
> +	struct argv_array args = ARGV_ARRAY_INIT;
>  
> -	argv[argc++] = "fetch-pack";
> -	argv[argc++] = "--stateless-rpc";
> -	argv[argc++] = "--stdin";
> -	argv[argc++] = "--lock-pack";
> +	argv_array_pushl(&args, "fetch-pack", "--stateless-rpc",
> +			 "--stdin", "--lock-pack",
> +			 NULL);

A lone NULL after a reasonably short line looks somewhat irritating,
but if you are planning to add more on that short line in the later
patch, it is OK.  Let's keep reading.

The remainder of this patch looked obviously correct.

Thanks.