diff options
author | Jeff King <peff@peff.net> | 2020-07-28 22:24:53 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-29 00:02:18 +0200 |
commit | ef8d7ac42a6a62d678166fe25ea743315809d2bb (patch) | |
tree | 41974632658fdc804d42d3c98859bd8f259828c8 /exec-cmd.c | |
parent | strvec: convert builtin/ callers away from argv_array name (diff) | |
download | git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.tar.xz git-ef8d7ac42a6a62d678166fe25ea743315809d2bb.zip |
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 'exec-cmd.c')
-rw-r--r-- | exec-cmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/exec-cmd.c b/exec-cmd.c index bb24c2f3bc..0f8e888424 100644 --- a/exec-cmd.c +++ b/exec-cmd.c @@ -320,16 +320,16 @@ void setup_path(void) strbuf_release(&new_path); } -const char **prepare_git_cmd(struct argv_array *out, const char **argv) +const char **prepare_git_cmd(struct strvec *out, const char **argv) { - argv_array_push(out, "git"); - argv_array_pushv(out, argv); + strvec_push(out, "git"); + strvec_pushv(out, argv); return out->argv; } int execv_git_cmd(const char **argv) { - struct argv_array nargv = ARGV_ARRAY_INIT; + struct strvec nargv = STRVEC_INIT; prepare_git_cmd(&nargv, argv); trace_argv_printf(nargv.argv, "trace: exec:"); @@ -339,7 +339,7 @@ int execv_git_cmd(const char **argv) trace_printf("trace: exec failed: %s\n", strerror(errno)); - argv_array_clear(&nargv); + strvec_clear(&nargv); return -1; } |