submodule--helper: remove add-clone subcommand
We no longer need this subcommand, as all of its functionality is being called by the newly-introduced `module_add()` directly within C. Signed-off-by: Atharva Raykar <raykar.ath@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Shourya Shukla <periperidip@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
a6226fd772
commit
f006132c24
@ -2860,65 +2860,6 @@ static int add_submodule(const struct add_data *add_data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int add_clone(int argc, const char **argv, const char *prefix)
|
|
||||||
{
|
|
||||||
int force = 0, quiet = 0, dissociate = 0, progress = 0;
|
|
||||||
struct add_data add_data = ADD_DATA_INIT;
|
|
||||||
|
|
||||||
struct option options[] = {
|
|
||||||
OPT_STRING('b', "branch", &add_data.branch,
|
|
||||||
N_("branch"),
|
|
||||||
N_("branch of repository to checkout on cloning")),
|
|
||||||
OPT_STRING(0, "prefix", &prefix,
|
|
||||||
N_("path"),
|
|
||||||
N_("alternative anchor for relative paths")),
|
|
||||||
OPT_STRING(0, "path", &add_data.sm_path,
|
|
||||||
N_("path"),
|
|
||||||
N_("where the new submodule will be cloned to")),
|
|
||||||
OPT_STRING(0, "name", &add_data.sm_name,
|
|
||||||
N_("string"),
|
|
||||||
N_("name of the new submodule")),
|
|
||||||
OPT_STRING(0, "url", &add_data.realrepo,
|
|
||||||
N_("string"),
|
|
||||||
N_("url where to clone the submodule from")),
|
|
||||||
OPT_STRING(0, "reference", &add_data.reference_path,
|
|
||||||
N_("repo"),
|
|
||||||
N_("reference repository")),
|
|
||||||
OPT_BOOL(0, "dissociate", &dissociate,
|
|
||||||
N_("use --reference only while cloning")),
|
|
||||||
OPT_INTEGER(0, "depth", &add_data.depth,
|
|
||||||
N_("depth for shallow clones")),
|
|
||||||
OPT_BOOL(0, "progress", &progress,
|
|
||||||
N_("force cloning progress")),
|
|
||||||
OPT__FORCE(&force, N_("allow adding an otherwise ignored submodule path"),
|
|
||||||
PARSE_OPT_NOCOMPLETE),
|
|
||||||
OPT__QUIET(&quiet, "suppress output for cloning a submodule"),
|
|
||||||
OPT_END()
|
|
||||||
};
|
|
||||||
|
|
||||||
const char *const usage[] = {
|
|
||||||
N_("git submodule--helper add-clone [<options>...] "
|
|
||||||
"--url <url> --path <path> --name <name>"),
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix, options, usage, 0);
|
|
||||||
|
|
||||||
if (argc != 0)
|
|
||||||
usage_with_options(usage, options);
|
|
||||||
|
|
||||||
add_data.prefix = prefix;
|
|
||||||
add_data.progress = !!progress;
|
|
||||||
add_data.dissociate = !!dissociate;
|
|
||||||
add_data.force = !!force;
|
|
||||||
add_data.quiet = !!quiet;
|
|
||||||
|
|
||||||
if (add_submodule(&add_data))
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int config_submodule_in_gitmodules(const char *name, const char *var, const char *value)
|
static int config_submodule_in_gitmodules(const char *name, const char *var, const char *value)
|
||||||
{
|
{
|
||||||
char *key;
|
char *key;
|
||||||
@ -3221,7 +3162,6 @@ static struct cmd_struct commands[] = {
|
|||||||
{"list", module_list, 0},
|
{"list", module_list, 0},
|
||||||
{"name", module_name, 0},
|
{"name", module_name, 0},
|
||||||
{"clone", module_clone, 0},
|
{"clone", module_clone, 0},
|
||||||
{"add-clone", add_clone, 0},
|
|
||||||
{"add-config", add_config, 0},
|
{"add-config", add_config, 0},
|
||||||
{"add", module_add, SUPPORT_SUPER_PREFIX},
|
{"add", module_add, SUPPORT_SUPER_PREFIX},
|
||||||
{"update-module-mode", module_update_module_mode, 0},
|
{"update-module-mode", module_update_module_mode, 0},
|
||||||
|
Loading…
Reference in New Issue
Block a user