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>
This commit is contained in:
Jeff King
2020-07-28 16:25:12 -04:00
committed by Junio C Hamano
parent ef8d7ac42a
commit c972bf4cf5
33 changed files with 385 additions and 385 deletions

View File

@ -68,7 +68,7 @@ const char *git_pager(int stdout_is_tty)
return pager;
}
static void setup_pager_env(struct argv_array *env)
static void setup_pager_env(struct strvec *env)
{
const char **argv;
int i;
@ -88,7 +88,7 @@ static void setup_pager_env(struct argv_array *env)
*cp = '\0';
if (!getenv(argv[i])) {
*cp = '=';
argv_array_push(env, argv[i]);
strvec_push(env, argv[i]);
}
}
free(pager_env);
@ -97,7 +97,7 @@ static void setup_pager_env(struct argv_array *env)
void prepare_pager_args(struct child_process *pager_process, const char *pager)
{
argv_array_push(&pager_process->args, pager);
strvec_push(&pager_process->args, pager);
pager_process->use_shell = 1;
setup_pager_env(&pager_process->env_array);
pager_process->trace2_child_class = "pager";
@ -126,7 +126,7 @@ void setup_pager(void)
/* spawn the pager */
prepare_pager_args(&pager_process, pager);
pager_process.in = -1;
argv_array_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
strvec_push(&pager_process.env_array, "GIT_PAGER_IN_USE");
if (start_command(&pager_process))
return;