summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-05-15 08:35:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-15 16:49:11 (GMT)
commit173fd1a1a44b89a204eb1289e4ff1f9d733e0cf1 (patch)
tree27b8806bf7467e36e6828a8ce594993156bc9cbd
parent2aeae40a754ed8296df95df263e694ad4eab3a49 (diff)
downloadgit-173fd1a1a44b89a204eb1289e4ff1f9d733e0cf1.zip
git-173fd1a1a44b89a204eb1289e4ff1f9d733e0cf1.tar.gz
git-173fd1a1a44b89a204eb1289e4ff1f9d733e0cf1.tar.bz2
get_importer: use run-command's internal argv_array
This saves a few lines and lets us avoid having to clean up the memory manually when the command finishes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--transport-helper.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 9f8f3b1..d9063d7 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -394,18 +394,16 @@ static int get_importer(struct transport *transport, struct child_process *fasti
{
struct child_process *helper = get_helper(transport);
struct helper_data *data = transport->data;
- struct argv_array argv = ARGV_ARRAY_INIT;
int cat_blob_fd, code;
memset(fastimport, 0, sizeof(*fastimport));
fastimport->in = helper->out;
- argv_array_push(&argv, "fast-import");
- argv_array_push(&argv, debug ? "--stats" : "--quiet");
+ argv_array_push(&fastimport->args, "fast-import");
+ argv_array_push(&fastimport->args, debug ? "--stats" : "--quiet");
if (data->bidi_import) {
cat_blob_fd = xdup(helper->in);
- argv_array_pushf(&argv, "--cat-blob-fd=%d", cat_blob_fd);
+ argv_array_pushf(&fastimport->args, "--cat-blob-fd=%d", cat_blob_fd);
}
- fastimport->argv = argv.argv;
fastimport->git_cmd = 1;
code = start_command(fastimport);
@@ -476,7 +474,6 @@ static int fetch_with_import(struct transport *transport,
if (finish_command(&fastimport))
die("Error while running fast-import");
- argv_array_free_detached(fastimport.argv);
/*
* The fast-import stream of a remote helper that advertises