Skip to content

Commit 37d6f93

Browse files
committed
Merge branch 'jk/clone-dissociate' into maint
Code clean-up. * jk/clone-dissociate: clone: reorder --dissociate and --reference options clone: use OPT_STRING_LIST for --reference
2 parents 0d9388d + 14f8b9b commit 37d6f93

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

builtin/clone.c

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ static struct string_list option_config;
5151
static struct string_list option_reference;
5252
static int option_dissociate;
5353

54-
static int opt_parse_reference(const struct option *opt, const char *arg, int unset)
55-
{
56-
struct string_list *option_reference = opt->value;
57-
if (!arg)
58-
return -1;
59-
string_list_append(option_reference, arg);
60-
return 0;
61-
}
62-
6354
static struct option builtin_clone_options[] = {
6455
OPT__VERBOSITY(&option_verbosity),
6556
OPT_BOOL(0, "progress", &option_progress,
@@ -83,8 +74,10 @@ static struct option builtin_clone_options[] = {
8374
N_("initialize submodules in the clone")),
8475
OPT_STRING(0, "template", &option_template, N_("template-directory"),
8576
N_("directory from which templates will be used")),
86-
OPT_CALLBACK(0 , "reference", &option_reference, N_("repo"),
87-
N_("reference repository"), &opt_parse_reference),
77+
OPT_STRING_LIST(0, "reference", &option_reference, N_("repo"),
78+
N_("reference repository")),
79+
OPT_BOOL(0, "dissociate", &option_dissociate,
80+
N_("use --reference only while cloning")),
8881
OPT_STRING('o', "origin", &option_origin, N_("name"),
8982
N_("use <name> instead of 'origin' to track upstream")),
9083
OPT_STRING('b', "branch", &option_branch, N_("branch"),
@@ -95,8 +88,6 @@ static struct option builtin_clone_options[] = {
9588
N_("create a shallow clone of that depth")),
9689
OPT_BOOL(0, "single-branch", &option_single_branch,
9790
N_("clone only one branch, HEAD or --branch")),
98-
OPT_BOOL(0, "dissociate", &option_dissociate,
99-
N_("use --reference only while cloning")),
10091
OPT_STRING(0, "separate-git-dir", &real_git_dir, N_("gitdir"),
10192
N_("separate git dir from working tree")),
10293
OPT_STRING_LIST('c', "config", &option_config, N_("key=value"),

0 commit comments

Comments
 (0)