Skip to content

Commit 49fd5b9

Browse files
avargitster
authored andcommitted
builtin/submodule--helper.c: rename option struct to "opt"
In a later commit, update_clone()'s options will be stored in a struct update_data instead of submodule_update_clone. Preemptively rename the options struct to "opt" to shrink that commit's diff. Helped-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]> Signed-off-by: Glen Choo <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 55b3f12 commit 49fd5b9

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

builtin/submodule--helper.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,40 +2498,40 @@ static int update_clone(int argc, const char **argv, const char *prefix)
24982498
{
24992499
const char *update = NULL;
25002500
struct pathspec pathspec;
2501-
struct submodule_update_clone suc = SUBMODULE_UPDATE_CLONE_INIT;
2501+
struct submodule_update_clone opt = SUBMODULE_UPDATE_CLONE_INIT;
25022502
struct list_objects_filter_options filter_options;
25032503
int ret;
25042504

25052505
struct option module_update_clone_options[] = {
2506-
OPT_BOOL(0, "init", &suc.init,
2506+
OPT_BOOL(0, "init", &opt.init,
25072507
N_("initialize uninitialized submodules before update")),
25082508
OPT_STRING(0, "prefix", &prefix,
25092509
N_("path"),
25102510
N_("path into the working tree")),
2511-
OPT_STRING(0, "recursive-prefix", &suc.recursive_prefix,
2511+
OPT_STRING(0, "recursive-prefix", &opt.recursive_prefix,
25122512
N_("path"),
25132513
N_("path into the working tree, across nested "
25142514
"submodule boundaries")),
25152515
OPT_STRING(0, "update", &update,
25162516
N_("string"),
25172517
N_("rebase, merge, checkout or none")),
2518-
OPT_STRING_LIST(0, "reference", &suc.references, N_("repo"),
2518+
OPT_STRING_LIST(0, "reference", &opt.references, N_("repo"),
25192519
N_("reference repository")),
2520-
OPT_BOOL(0, "dissociate", &suc.dissociate,
2520+
OPT_BOOL(0, "dissociate", &opt.dissociate,
25212521
N_("use --reference only while cloning")),
2522-
OPT_STRING(0, "depth", &suc.depth, "<depth>",
2522+
OPT_STRING(0, "depth", &opt.depth, "<depth>",
25232523
N_("create a shallow clone truncated to the "
25242524
"specified number of revisions")),
2525-
OPT_INTEGER('j', "jobs", &suc.max_jobs,
2525+
OPT_INTEGER('j', "jobs", &opt.max_jobs,
25262526
N_("parallel jobs")),
2527-
OPT_BOOL(0, "recommend-shallow", &suc.recommend_shallow,
2527+
OPT_BOOL(0, "recommend-shallow", &opt.recommend_shallow,
25282528
N_("whether the initial clone should follow the shallow recommendation")),
2529-
OPT__QUIET(&suc.quiet, N_("don't print cloning progress")),
2530-
OPT_BOOL(0, "progress", &suc.progress,
2529+
OPT__QUIET(&opt.quiet, N_("don't print cloning progress")),
2530+
OPT_BOOL(0, "progress", &opt.progress,
25312531
N_("force cloning progress")),
2532-
OPT_BOOL(0, "require-init", &suc.require_init,
2532+
OPT_BOOL(0, "require-init", &opt.require_init,
25332533
N_("disallow cloning into non-empty directory")),
2534-
OPT_BOOL(0, "single-branch", &suc.single_branch,
2534+
OPT_BOOL(0, "single-branch", &opt.single_branch,
25352535
N_("clone only one branch, HEAD or --branch")),
25362536
OPT_PARSE_LIST_OBJECTS_FILTER(&filter_options),
25372537
OPT_END()
@@ -2546,16 +2546,16 @@ static int update_clone(int argc, const char **argv, const char *prefix)
25462546
" [--recursive] [--[no-]single-branch] [--] [<path>...]"),
25472547
NULL
25482548
};
2549-
suc.prefix = prefix;
2549+
opt.prefix = prefix;
25502550

2551-
update_clone_config_from_gitmodules(&suc.max_jobs);
2552-
git_config(git_update_clone_config, &suc.max_jobs);
2551+
update_clone_config_from_gitmodules(&opt.max_jobs);
2552+
git_config(git_update_clone_config, &opt.max_jobs);
25532553

25542554
memset(&filter_options, 0, sizeof(filter_options));
25552555
argc = parse_options(argc, argv, prefix, module_update_clone_options,
25562556
git_submodule_helper_usage, 0);
25572557

2558-
if (filter_options.choice && !suc.init) {
2558+
if (filter_options.choice && !opt.init) {
25592559
/*
25602560
* NEEDSWORK: Don't use usage_with_options() because the
25612561
* usage string is for "git submodule update", but the
@@ -2567,25 +2567,25 @@ static int update_clone(int argc, const char **argv, const char *prefix)
25672567
usage(git_submodule_helper_usage[0]);
25682568
}
25692569

2570-
suc.filter_options = &filter_options;
2570+
opt.filter_options = &filter_options;
25712571

25722572
if (update)
2573-
if (parse_submodule_update_strategy(update, &suc.update) < 0)
2573+
if (parse_submodule_update_strategy(update, &opt.update) < 0)
25742574
die(_("bad value for update parameter"));
25752575

2576-
if (module_list_compute(argc, argv, prefix, &pathspec, &suc.list) < 0) {
2576+
if (module_list_compute(argc, argv, prefix, &pathspec, &opt.list) < 0) {
25772577
list_objects_filter_release(&filter_options);
25782578
return 1;
25792579
}
25802580

25812581
if (pathspec.nr)
2582-
suc.warn_if_uninitialized = 1;
2582+
opt.warn_if_uninitialized = 1;
25832583

2584-
if (suc.init) {
2584+
if (opt.init) {
25852585
struct module_list list = MODULE_LIST_INIT;
25862586
struct init_cb info = INIT_CB_INIT;
25872587

2588-
if (module_list_compute(argc, argv, suc.prefix,
2588+
if (module_list_compute(argc, argv, opt.prefix,
25892589
&pathspec, &list) < 0)
25902590
return 1;
25912591

@@ -2596,15 +2596,15 @@ static int update_clone(int argc, const char **argv, const char *prefix)
25962596
if (!argc && git_config_get_value_multi("submodule.active"))
25972597
module_list_active(&list);
25982598

2599-
info.prefix = suc.prefix;
2600-
info.superprefix = suc.recursive_prefix;
2601-
if (suc.quiet)
2599+
info.prefix = opt.prefix;
2600+
info.superprefix = opt.recursive_prefix;
2601+
if (opt.quiet)
26022602
info.flags |= OPT_QUIET;
26032603

26042604
for_each_listed_submodule(&list, init_submodule_cb, &info);
26052605
}
26062606

2607-
ret = update_submodules(&suc);
2607+
ret = update_submodules(&opt);
26082608
list_objects_filter_release(&filter_options);
26092609
return ret;
26102610
}

0 commit comments

Comments
 (0)