]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule--helper: remove add-clone subcommand
authorAtharva Raykar <raykar.ath@gmail.com>
Tue, 10 Aug 2021 11:46:38 +0000 (17:16 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Aug 2021 18:45:11 +0000 (11:45 -0700)
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>
builtin/submodule--helper.c

index 0e94e16f4d98dd001e4890b5d54c23039e8b783a..1c81f15a24046fcf11a5651cf301296a8981c941 100644 (file)
@@ -2860,65 +2860,6 @@ static int add_submodule(const struct add_data *add_data)
        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)
 {
        char *key;
@@ -3221,7 +3162,6 @@ static struct cmd_struct commands[] = {
        {"list", module_list, 0},
        {"name", module_name, 0},
        {"clone", module_clone, 0},
-       {"add-clone", add_clone, 0},
        {"add-config", add_config, 0},
        {"add", module_add, SUPPORT_SUPER_PREFIX},
        {"update-module-mode", module_update_module_mode, 0},