diff options
author | Jeff King <peff@peff.net> | 2020-07-29 03:37:20 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-31 05:18:06 +0300 |
commit | d70a9eb611a9d242c1d26847d223b8677609305b (patch) | |
tree | 2c7f218e0037607dfbf8c92ef34a5d412ceac78c /t/helper/test-run-command.c | |
parent | b5eb741a00155f888a9a4ced87c840a2b7b04f5a (diff) |
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 't/helper/test-run-command.c')
-rw-r--r-- | t/helper/test-run-command.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index 726835fcc2..7ae03dc712 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -248,7 +248,7 @@ static int quote_stress_test(int argc, const char **argv) else strvec_pushl(&args, "test-tool", "run-command", "quote-echo", NULL); - arg_offset = args.argc; + arg_offset = args.nr; if (argc > 0) { trials = 1; @@ -275,13 +275,13 @@ static int quote_stress_test(int argc, const char **argv) if (i < skip) continue; - cp.argv = args.argv; + cp.argv = args.v; strbuf_reset(&out); if (pipe_command(&cp, NULL, 0, &out, 0, NULL, 0) < 0) return error("Failed to spawn child process"); for (j = 0, k = 0; j < arg_count; j++) { - const char *arg = args.argv[j + arg_offset]; + const char *arg = args.v[j + arg_offset]; if (strcmp(arg, out.buf + k)) ret = error("incorrectly quoted arg: '%s', " @@ -298,7 +298,7 @@ static int quote_stress_test(int argc, const char **argv) fprintf(stderr, "Trial #%d failed. Arguments:\n", i); for (j = 0; j < arg_count; j++) fprintf(stderr, "arg #%d: '%s'\n", - (int)j, args.argv[j + arg_offset]); + (int)j, args.v[j + arg_offset]); strbuf_release(&out); strvec_clear(&args); |