diff options
author | Jeff King <peff@peff.net> | 2020-07-28 20:37:20 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-07-30 19:18:06 -0700 |
commit | d70a9eb611a9d242c1d26847d223b8677609305b (patch) | |
tree | 2c7f218e0037607dfbf8c92ef34a5d412ceac78c /builtin/stash.c | |
parent | strvec: drop argv_array compatibility layer (diff) | |
download | tgif-d70a9eb611a9d242c1d26847d223b8677609305b.tar.xz |
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 'builtin/stash.c')
-rw-r--r-- | builtin/stash.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index bfdbafae89..10d87630cd 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -745,7 +745,7 @@ static int show_stash(int argc, const char **argv, const char *prefix) strvec_push(&revision_args, argv[i]); } - ret = get_stash_info(&info, stash_args.argc, stash_args.argv); + ret = get_stash_info(&info, stash_args.nr, stash_args.v); strvec_clear(&stash_args); if (ret) return -1; @@ -754,7 +754,7 @@ static int show_stash(int argc, const char **argv, const char *prefix) * The config settings are applied only if there are not passed * any options. */ - if (revision_args.argc == 1) { + if (revision_args.nr == 1) { if (show_stat) rev.diffopt.output_format = DIFF_FORMAT_DIFFSTAT; @@ -767,7 +767,7 @@ static int show_stash(int argc, const char **argv, const char *prefix) } } - argc = setup_revisions(revision_args.argc, revision_args.argv, &rev, NULL); + argc = setup_revisions(revision_args.nr, revision_args.v, &rev, NULL); if (argc > 1) { free_stash_info(&info); usage_with_options(git_stash_show_usage, options); @@ -1611,5 +1611,5 @@ int cmd_stash(int argc, const char **argv, const char *prefix) /* Assume 'stash push' */ strvec_push(&args, "push"); strvec_pushv(&args, argv); - return !!push_stash(args.argc, args.argv, prefix, 1); + return !!push_stash(args.nr, args.v, prefix, 1); } |