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>
This commit is contained in:

committed by
Junio C Hamano

parent
2745b6b450
commit
22f9b7f3f5
@ -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."));
|
||||
|
Reference in New Issue
Block a user