summaryrefslogtreecommitdiff
path: root/builtin/repack.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2020-07-28 16:24:27 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-28 15:02:18 -0700
commit22f9b7f3f59549735a480042a4b9ce292eedfae0 (patch)
treeaf564ca6084c9790ea99dd60291d7aa9f854fecb /builtin/repack.c
parentquote: rename sq_dequote_to_argv_array to mention strvec (diff)
downloadtgif-22f9b7f3f59549735a480042a4b9ce292eedfae0.tar.xz
strvec: convert builtin/ 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 files in builtin/ 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 builtin/". 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 'builtin/repack.c')
-rw-r--r--builtin/repack.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/builtin/repack.c b/builtin/repack.c
index 8bccb38a28..7435ee9af1 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -153,28 +153,28 @@ struct pack_objects_args {
static void prepare_pack_objects(struct child_process *cmd,
const struct pack_objects_args *args)
{
- argv_array_push(&cmd->args, "pack-objects");
+ strvec_push(&cmd->args, "pack-objects");
if (args->window)
- argv_array_pushf(&cmd->args, "--window=%s", args->window);
+ strvec_pushf(&cmd->args, "--window=%s", args->window);
if (args->window_memory)
- argv_array_pushf(&cmd->args, "--window-memory=%s", args->window_memory);
+ strvec_pushf(&cmd->args, "--window-memory=%s", args->window_memory);
if (args->depth)
- argv_array_pushf(&cmd->args, "--depth=%s", args->depth);
+ strvec_pushf(&cmd->args, "--depth=%s", args->depth);
if (args->threads)
- argv_array_pushf(&cmd->args, "--threads=%s", args->threads);
+ strvec_pushf(&cmd->args, "--threads=%s", args->threads);
if (args->max_pack_size)
- argv_array_pushf(&cmd->args, "--max-pack-size=%s", args->max_pack_size);
+ strvec_pushf(&cmd->args, "--max-pack-size=%s", args->max_pack_size);
if (args->no_reuse_delta)
- argv_array_pushf(&cmd->args, "--no-reuse-delta");
+ strvec_pushf(&cmd->args, "--no-reuse-delta");
if (args->no_reuse_object)
- argv_array_pushf(&cmd->args, "--no-reuse-object");
+ strvec_pushf(&cmd->args, "--no-reuse-object");
if (args->local)
- argv_array_push(&cmd->args, "--local");
+ strvec_push(&cmd->args, "--local");
if (args->quiet)
- argv_array_push(&cmd->args, "--quiet");
+ strvec_push(&cmd->args, "--quiet");
if (delta_base_offset)
- argv_array_push(&cmd->args, "--delta-base-offset");
- argv_array_push(&cmd->args, packtmp);
+ strvec_push(&cmd->args, "--delta-base-offset");
+ strvec_push(&cmd->args, packtmp);
cmd->git_cmd = 1;
cmd->out = -1;
}
@@ -361,24 +361,24 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
prepare_pack_objects(&cmd, &po_args);
- argv_array_push(&cmd.args, "--keep-true-parents");
+ strvec_push(&cmd.args, "--keep-true-parents");
if (!pack_kept_objects)
- argv_array_push(&cmd.args, "--honor-pack-keep");
+ strvec_push(&cmd.args, "--honor-pack-keep");
for (i = 0; i < keep_pack_list.nr; i++)
- argv_array_pushf(&cmd.args, "--keep-pack=%s",
+ strvec_pushf(&cmd.args, "--keep-pack=%s",
keep_pack_list.items[i].string);
- argv_array_push(&cmd.args, "--non-empty");
- argv_array_push(&cmd.args, "--all");
- argv_array_push(&cmd.args, "--reflog");
- argv_array_push(&cmd.args, "--indexed-objects");
+ strvec_push(&cmd.args, "--non-empty");
+ strvec_push(&cmd.args, "--all");
+ strvec_push(&cmd.args, "--reflog");
+ strvec_push(&cmd.args, "--indexed-objects");
if (has_promisor_remote())
- argv_array_push(&cmd.args, "--exclude-promisor-objects");
+ strvec_push(&cmd.args, "--exclude-promisor-objects");
if (write_bitmaps > 0)
- argv_array_push(&cmd.args, "--write-bitmap-index");
+ strvec_push(&cmd.args, "--write-bitmap-index");
else if (write_bitmaps < 0)
- argv_array_push(&cmd.args, "--write-bitmap-index-quiet");
+ strvec_push(&cmd.args, "--write-bitmap-index-quiet");
if (use_delta_islands)
- argv_array_push(&cmd.args, "--delta-islands");
+ strvec_push(&cmd.args, "--delta-islands");
if (pack_everything & ALL_INTO_ONE) {
get_non_kept_pack_filenames(&existing_packs, &keep_pack_list);
@@ -387,23 +387,23 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
if (existing_packs.nr && delete_redundant) {
if (unpack_unreachable) {
- argv_array_pushf(&cmd.args,
+ strvec_pushf(&cmd.args,
"--unpack-unreachable=%s",
unpack_unreachable);
- argv_array_push(&cmd.env_array, "GIT_REF_PARANOIA=1");
+ strvec_push(&cmd.env_array, "GIT_REF_PARANOIA=1");
} else if (pack_everything & LOOSEN_UNREACHABLE) {
- argv_array_push(&cmd.args,
+ strvec_push(&cmd.args,
"--unpack-unreachable");
} else if (keep_unreachable) {
- argv_array_push(&cmd.args, "--keep-unreachable");
- argv_array_push(&cmd.args, "--pack-loose-unreachable");
+ strvec_push(&cmd.args, "--keep-unreachable");
+ strvec_push(&cmd.args, "--pack-loose-unreachable");
} else {
- argv_array_push(&cmd.env_array, "GIT_REF_PARANOIA=1");
+ strvec_push(&cmd.env_array, "GIT_REF_PARANOIA=1");
}
}
} else {
- argv_array_push(&cmd.args, "--unpacked");
- argv_array_push(&cmd.args, "--incremental");
+ strvec_push(&cmd.args, "--unpacked");
+ strvec_push(&cmd.args, "--incremental");
}
cmd.no_stdin = 1;