diff options
author | Jeff King <peff@peff.net> | 2020-07-29 02:37:20 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-31 04:18:06 +0200 |
commit | d70a9eb611a9d242c1d26847d223b8677609305b (patch) | |
tree | 2c7f218e0037607dfbf8c92ef34a5d412ceac78c /exec-cmd.c | |
parent | strvec: drop argv_array compatibility layer (diff) | |
download | git-d70a9eb611a9d242c1d26847d223b8677609305b.tar.xz git-d70a9eb611a9d242c1d26847d223b8677609305b.zip |
strvec: rename struct fields
The "argc" and "argv" names made sense when the struct was argv_array,
but now they're just confusing. Let's rename them to "nr" (which we use
for counts elsewhere) and "v" (which is rather terse, but reads well
when combined with typical variable names like "args.v").
Note that we have to update all of the callers immediately. Playing
tricks with the preprocessor is hard here, because we wouldn't want to
rewrite unrelated tokens.
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/exec-cmd.c b/exec-cmd.c index 0f8e888424..eeb2ee52b8 100644 --- a/exec-cmd.c +++ b/exec-cmd.c @@ -324,7 +324,7 @@ const char **prepare_git_cmd(struct strvec *out, const char **argv) { strvec_push(out, "git"); strvec_pushv(out, argv); - return out->argv; + return out->v; } int execv_git_cmd(const char **argv) @@ -332,10 +332,10 @@ int execv_git_cmd(const char **argv) struct strvec nargv = STRVEC_INIT; prepare_git_cmd(&nargv, argv); - trace_argv_printf(nargv.argv, "trace: exec:"); + trace_argv_printf(nargv.v, "trace: exec:"); /* execvp() can only ever return if it fails */ - sane_execvp("git", (char **)nargv.argv); + sane_execvp("git", (char **)nargv.v); trace_printf("trace: exec failed: %s\n", strerror(errno)); |