summaryrefslogtreecommitdiff
path: root/builtin/bundle.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/bundle.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/bundle.c')
-rw-r--r--builtin/bundle.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 51fc6d9739..750630bdd9 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -59,7 +59,7 @@ static int parse_options_cmd_bundle(int argc,
static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
int all_progress_implied = 0;
int progress = isatty(STDERR_FILENO);
- struct argv_array pack_opts;
+ struct strvec pack_opts;
struct option options[] = {
OPT_SET_INT('q', "quiet", &progress,
@@ -79,15 +79,15 @@ static int cmd_bundle_create(int argc, const char **argv, const char *prefix) {
builtin_bundle_create_usage, options, &bundle_file);
/* bundle internals use argv[1] as further parameters */
- argv_array_init(&pack_opts);
+ strvec_init(&pack_opts);
if (progress == 0)
- argv_array_push(&pack_opts, "--quiet");
+ strvec_push(&pack_opts, "--quiet");
else if (progress == 1)
- argv_array_push(&pack_opts, "--progress");
+ strvec_push(&pack_opts, "--progress");
else if (progress == 2)
- argv_array_push(&pack_opts, "--all-progress");
+ strvec_push(&pack_opts, "--all-progress");
if (progress && all_progress_implied)
- argv_array_push(&pack_opts, "--all-progress-implied");
+ strvec_push(&pack_opts, "--all-progress-implied");
if (!startup_info->have_repository)
die(_("Need a repository to create a bundle."));