summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2020-07-28 20:37:20 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-07-30 19:18:06 -0700
commitd70a9eb611a9d242c1d26847d223b8677609305b (patch)
tree2c7f218e0037607dfbf8c92ef34a5d412ceac78c /builtin/show-branch.c
parentstrvec: drop argv_array compatibility layer (diff)
downloadtgif-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/show-branch.c')
-rw-r--r--builtin/show-branch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 4c918ce90d..7eae5f3801 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -561,7 +561,7 @@ static int git_show_branch_config(const char *var, const char *value, void *cb)
* default_arg is now passed to parse_options(), so we need to
* mimic the real argv a bit better.
*/
- if (!default_args.argc)
+ if (!default_args.nr)
strvec_push(&default_args, "show-branch");
strvec_push(&default_args, value);
return 0;
@@ -684,9 +684,9 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
git_config(git_show_branch_config, NULL);
/* If nothing is specified, try the default first */
- if (ac == 1 && default_args.argc) {
- ac = default_args.argc;
- av = default_args.argv;
+ if (ac == 1 && default_args.nr) {
+ ac = default_args.nr;
+ av = default_args.v;
}
ac = parse_options(ac, av, prefix, builtin_show_branch_options,