git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remote-testsvn: use internal argv_array of struct child_process in cmd_import()

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2014, 19:10 UTC
Message-ID
<xmqq8unqmqk7.fsf@gitster.dls.corp.google.com>
In-Reply-To
<53C93B33.5070006@web.de>
René Scharfe <l.s.r@web.de> writes:
Show 5 quoted lines
> Use the existing argv_array member instead of providing our own.  This
> way we don't have to initialize or clean it up explicitly.
>
> Signed-off-by: Rene Scharfe <l.s.r@web.de>
> ---

The change below looks so trivial and I cannot offhand see why it would break t9020 in a reproducible way.

Puzzled...
Show 39 quoted lines
>  remote-testsvn.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/remote-testsvn.c b/remote-testsvn.c
> index 6be55cb..31415bd 100644
> --- a/remote-testsvn.c
> +++ b/remote-testsvn.c
> @@ -175,7 +175,6 @@ static int cmd_import(const char *line)
>  	char *note_msg;
>  	unsigned char head_sha1[20];
>  	unsigned int startrev;
> -	struct argv_array svndump_argv = ARGV_ARRAY_INIT;
>  	struct child_process svndump_proc;
>  
>  	if (read_ref(private_ref, head_sha1))
> @@ -202,11 +201,10 @@ static int cmd_import(const char *line)
>  	} else {
>  		memset(&svndump_proc, 0, sizeof(struct child_process));
>  		svndump_proc.out = -1;
> -		argv_array_push(&svndump_argv, "svnrdump");
> -		argv_array_push(&svndump_argv, "dump");
> -		argv_array_push(&svndump_argv, url);
> -		argv_array_pushf(&svndump_argv, "-r%u:HEAD", startrev);
> -		svndump_proc.argv = svndump_argv.argv;
> +		argv_array_push(&svndump_proc.args, "svnrdump");
> +		argv_array_push(&svndump_proc.args, "dump");
> +		argv_array_push(&svndump_proc.args, url);
> +		argv_array_pushf(&svndump_proc.args, "-r%u:HEAD", startrev);
>  
>  		code = start_command(&svndump_proc);
>  		if (code)
> @@ -227,7 +225,6 @@ static int cmd_import(const char *line)
>  		code = finish_command(&svndump_proc);
>  		if (code)
>  			warning("%s, returned %d", svndump_proc.argv[0], code);
> -		argv_array_clear(&svndump_argv);
>  	}
>  
>  	return 0;
Previous: René ScharfeNext: René Scharfe
Message 2 of 6 in “remote-testsvn: use internal argv_array of struct child_process in cmd_import()”
  1. remote-testsvn: use internal argv_array of struct child_process in cmd_import()René Scharfe, Jul 18, 2014
  2. Junio C HamanoJul 18, 2014
  3. René ScharfeJul 18, 2014
  4. remote-testsvn: use internal argv_array of struct child_process in cmd_import()René Scharfe, Jul 18, 2014
  5. Junio C HamanoJul 18, 2014
  6. René ScharfeJul 18, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.