summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:25:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitc972bf4cf546a56fe1c54ddde1d33ebb9f454a0f (patch)
tree3a97c304c0e0ed4656cc5049ba44b4eb26e87a16 /transport-helper.c
parentef8d7ac42a6a62d678166fe25ea743315809d2bb (diff)
downloadgit-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.zip
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.gz
git-c972bf4cf546a56fe1c54ddde1d33ebb9f454a0f.tar.bz2
strvec: convert remaining callers away from argv_array name
We eventually want to drop the argv_array name and just use strvec consistently. There's no particular reason we have to do it all at once, or care about interactions between converted and unconverted bits. Because of our preprocessor compat layer, the names are interchangeable to the compiler (so even a definition and declaration using different names is OK). This patch converts all of the remaining files, as the resulting diff is reasonably sized. The conversion was done purely mechanically with: git ls-files '*.c' '*.h' | xargs perl -i -pe ' s/ARGV_ARRAY/STRVEC/g; s/argv_array/strvec/g; ' We'll deal with any indentation/style fallouts separately. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 441763f..dcd4adf 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -128,14 +128,14 @@ static struct child_process *get_helper(struct transport *transport)
helper->in = -1;
helper->out = -1;
helper->err = 0;
- argv_array_pushf(&helper->args, "git-remote-%s", data->name);
- argv_array_push(&helper->args, transport->remote->name);
- argv_array_push(&helper->args, remove_ext_force(transport->url));
+ strvec_pushf(&helper->args, "git-remote-%s", data->name);
+ strvec_push(&helper->args, transport->remote->name);
+ strvec_push(&helper->args, remove_ext_force(transport->url));
helper->git_cmd = 0;
helper->silent_exec_failure = 1;
if (have_git_dir())
- argv_array_pushf(&helper->env_array, "%s=%s",
+ strvec_pushf(&helper->env_array, "%s=%s",
GIT_DIR_ENVIRONMENT, get_git_dir());
helper->trace2_child_class = helper->args.argv[0]; /* "remote-<name>" */
@@ -439,13 +439,13 @@ static int get_importer(struct transport *transport, struct child_process *fasti
int cat_blob_fd, code;
child_process_init(fastimport);
fastimport->in = xdup(helper->out);
- argv_array_push(&fastimport->args, "fast-import");
- argv_array_push(&fastimport->args, "--allow-unsafe-features");
- argv_array_push(&fastimport->args, debug ? "--stats" : "--quiet");
+ strvec_push(&fastimport->args, "fast-import");
+ strvec_push(&fastimport->args, "--allow-unsafe-features");
+ strvec_push(&fastimport->args, debug ? "--stats" : "--quiet");
if (data->bidi_import) {
cat_blob_fd = xdup(helper->in);
- argv_array_pushf(&fastimport->args, "--cat-blob-fd=%d", cat_blob_fd);
+ strvec_pushf(&fastimport->args, "--cat-blob-fd=%d", cat_blob_fd);
}
fastimport->git_cmd = 1;
@@ -466,17 +466,17 @@ static int get_exporter(struct transport *transport,
/* we need to duplicate helper->in because we want to use it after
* fastexport is done with it. */
fastexport->out = dup(helper->in);
- argv_array_push(&fastexport->args, "fast-export");
- argv_array_push(&fastexport->args, "--use-done-feature");
- argv_array_push(&fastexport->args, data->signed_tags ?
+ strvec_push(&fastexport->args, "fast-export");
+ strvec_push(&fastexport->args, "--use-done-feature");
+ strvec_push(&fastexport->args, data->signed_tags ?
"--signed-tags=verbatim" : "--signed-tags=warn-strip");
if (data->export_marks)
- argv_array_pushf(&fastexport->args, "--export-marks=%s.tmp", data->export_marks);
+ strvec_pushf(&fastexport->args, "--export-marks=%s.tmp", data->export_marks);
if (data->import_marks)
- argv_array_pushf(&fastexport->args, "--import-marks=%s", data->import_marks);
+ strvec_pushf(&fastexport->args, "--import-marks=%s", data->import_marks);
for (i = 0; i < revlist_args->nr; i++)
- argv_array_push(&fastexport->args, revlist_args->items[i].string);
+ strvec_push(&fastexport->args, revlist_args->items[i].string);
fastexport->git_cmd = 1;
return start_command(fastexport);
@@ -1082,7 +1082,7 @@ static int has_attribute(const char *attrs, const char *attr)
}
static struct ref *get_refs_list(struct transport *transport, int for_push,
- const struct argv_array *ref_prefixes)
+ const struct strvec *ref_prefixes)
{
get_helper(transport);