summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-28 20:24:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-07-28 22:02:18 (GMT)
commitef8d7ac42a6a62d678166fe25ea743315809d2bb (patch)
tree41974632658fdc804d42d3c98859bd8f259828c8 /fetch-pack.c
parent22f9b7f3f59549735a480042a4b9ce292eedfae0 (diff)
downloadgit-ef8d7ac42a6a62d678166fe25ea743315809d2bb.zip
git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.tar.gz
git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.tar.bz2
strvec: convert more 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 remaining files from the first half of the alphabet, to keep the diff to a manageable size. 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; ' and then selectively staging files with "git add '[abcdefghjkl]*'". 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 'fetch-pack.c')
-rw-r--r--fetch-pack.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 80fb3bd..7aa5dfb 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -835,30 +835,30 @@ static int get_pack(struct fetch_pack_args *args,
}
if (alternate_shallow_file) {
- argv_array_push(&cmd.args, "--shallow-file");
- argv_array_push(&cmd.args, alternate_shallow_file);
+ strvec_push(&cmd.args, "--shallow-file");
+ strvec_push(&cmd.args, alternate_shallow_file);
}
if (do_keep || args->from_promisor) {
if (pack_lockfiles)
cmd.out = -1;
cmd_name = "index-pack";
- argv_array_push(&cmd.args, cmd_name);
- argv_array_push(&cmd.args, "--stdin");
+ strvec_push(&cmd.args, cmd_name);
+ strvec_push(&cmd.args, "--stdin");
if (!args->quiet && !args->no_progress)
- argv_array_push(&cmd.args, "-v");
+ strvec_push(&cmd.args, "-v");
if (args->use_thin_pack)
- argv_array_push(&cmd.args, "--fix-thin");
+ strvec_push(&cmd.args, "--fix-thin");
if (do_keep && (args->lock_pack || unpack_limit)) {
char hostname[HOST_NAME_MAX + 1];
if (xgethostname(hostname, sizeof(hostname)))
xsnprintf(hostname, sizeof(hostname), "localhost");
- argv_array_pushf(&cmd.args,
+ strvec_pushf(&cmd.args,
"--keep=fetch-pack %"PRIuMAX " on %s",
(uintmax_t)getpid(), hostname);
}
if (only_packfile && args->check_self_contained_and_connected)
- argv_array_push(&cmd.args, "--check-self-contained-and-connected");
+ strvec_push(&cmd.args, "--check-self-contained-and-connected");
else
/*
* We cannot perform any connectivity checks because
@@ -873,18 +873,18 @@ static int get_pack(struct fetch_pack_args *args,
* us.
*/
if (!(do_keep && pack_lockfiles) && args->from_promisor)
- argv_array_push(&cmd.args, "--promisor");
+ strvec_push(&cmd.args, "--promisor");
}
else {
cmd_name = "unpack-objects";
- argv_array_push(&cmd.args, cmd_name);
+ strvec_push(&cmd.args, cmd_name);
if (args->quiet || args->no_progress)
- argv_array_push(&cmd.args, "-q");
+ strvec_push(&cmd.args, "-q");
args->check_self_contained_and_connected = 0;
}
if (pass_header)
- argv_array_pushf(&cmd.args, "--pack_header=%"PRIu32",%"PRIu32,
+ strvec_pushf(&cmd.args, "--pack_header=%"PRIu32",%"PRIu32,
ntohl(header.hdr_version),
ntohl(header.hdr_entries));
if (fetch_fsck_objects >= 0
@@ -898,9 +898,9 @@ static int get_pack(struct fetch_pack_args *args,
* checks both broken objects and links, but we only
* want to check for broken objects.
*/
- argv_array_push(&cmd.args, "--fsck-objects");
+ strvec_push(&cmd.args, "--fsck-objects");
else
- argv_array_pushf(&cmd.args, "--strict%s",
+ strvec_pushf(&cmd.args, "--strict%s",
fsck_msg_types.buf);
}
@@ -1652,11 +1652,11 @@ static struct ref *do_fetch_pack_v2(struct fetch_pack_args *args,
const char *uri = packfile_uris.items[i].string +
the_hash_algo->hexsz + 1;
- argv_array_push(&cmd.args, "http-fetch");
- argv_array_pushf(&cmd.args, "--packfile=%.*s",
+ strvec_push(&cmd.args, "http-fetch");
+ strvec_pushf(&cmd.args, "--packfile=%.*s",
(int) the_hash_algo->hexsz,
packfile_uris.items[i].string);
- argv_array_push(&cmd.args, uri);
+ strvec_push(&cmd.args, uri);
cmd.git_cmd = 1;
cmd.no_stdin = 1;
cmd.out = -1;