Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-07-29 03:37:20 +0300
committerJunio C Hamano <gitster@pobox.com>2020-07-31 05:18:06 +0300
commitd70a9eb611a9d242c1d26847d223b8677609305b (patch)
tree2c7f218e0037607dfbf8c92ef34a5d412ceac78c /builtin/rebase.c
parentb5eb741a00155f888a9a4ced87c840a2b7b04f5a (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 'builtin/rebase.c')
-rw-r--r--builtin/rebase.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 35aeb8effc2..dadb52fa92e 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -351,7 +351,7 @@ static int do_interactive_rebase(struct rebase_options *opts, unsigned flags)
oid_to_hex(&opts->restrict_revision->object.oid));
ret = sequencer_make_script(the_repository, &todo_list.buf,
- make_script_args.argc, make_script_args.argv,
+ make_script_args.nr, make_script_args.v,
flags);
if (ret)
@@ -900,7 +900,7 @@ static int run_am(struct rebase_options *opts)
return status;
}
- strvec_pushv(&am.args, opts->git_am_opts.argv);
+ strvec_pushv(&am.args, opts->git_am_opts.v);
strvec_push(&am.args, "--rebasing");
strvec_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
strvec_push(&am.args, "--patch-format=mboxrd");
@@ -969,7 +969,7 @@ static int run_specific_rebase(struct rebase_options *opts, enum action action)
add_var(&script_snippet, "revisions", opts->revisions);
add_var(&script_snippet, "restrict_revision", opts->restrict_revision ?
oid_to_hex(&opts->restrict_revision->object.oid) : NULL);
- sq_quote_argv_pretty(&buf, opts->git_am_opts.argv);
+ sq_quote_argv_pretty(&buf, opts->git_am_opts.v);
add_var(&script_snippet, "git_am_opt", buf.buf);
strbuf_release(&buf);
add_var(&script_snippet, "verbose",
@@ -1625,8 +1625,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
allow_preemptive_ff = 0;
}
- for (i = 0; i < options.git_am_opts.argc; i++) {
- const char *option = options.git_am_opts.argv[i], *p;
+ for (i = 0; i < options.git_am_opts.nr; i++) {
+ const char *option = options.git_am_opts.v[i], *p;
if (!strcmp(option, "--committer-date-is-author-date") ||
!strcmp(option, "--ignore-date") ||
!strcmp(option, "--whitespace=fix") ||
@@ -1721,10 +1721,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (isatty(2) && options.flags & REBASE_NO_QUIET)
strbuf_addstr(&options.git_format_patch_opt, " --progress");
- if (options.git_am_opts.argc || options.type == REBASE_APPLY) {
+ if (options.git_am_opts.nr || options.type == REBASE_APPLY) {
/* all am options except -q are compatible only with --apply */
- for (i = options.git_am_opts.argc - 1; i >= 0; i--)
- if (strcmp(options.git_am_opts.argv[i], "-q"))
+ for (i = options.git_am_opts.nr - 1; i >= 0; i--)
+ if (strcmp(options.git_am_opts.v[i], "-q"))
break;
if (i >= 0) {