From: "René Scharfe" <l.s.r@web.de>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH] remote-testsvn: use internal argv_array of struct child_process in cmd_import()
Date: Fri, 18 Jul 2014 17:20:19 +0200 [thread overview]
Message-ID: <53C93B33.5070006@web.de> (raw)
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>
---
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;
--
2.0.0
next reply other threads:[~2014-07-18 15:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-18 15:20 René Scharfe [this message]
2014-07-18 19:10 ` [PATCH] remote-testsvn: use internal argv_array of struct child_process in cmd_import() Junio C Hamano
2014-07-18 19:30 ` René Scharfe
2014-07-18 19:55 ` [PATCH v2] " René Scharfe
2014-07-18 21:18 ` Junio C Hamano
2014-07-18 21:45 ` René Scharfe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C93B33.5070006@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).