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>

Atharva Raykar committed Aug 10, 2021 at 17:16 UTC f006132c243249f0eef01ba31b415426650e0916
1 file changed -60
builtin/submodule--helper.c
-60
@@ -2860,65 +2860,6 @@ static int add_submodule(const struct add_data *add_data)
2860 return 0;
2861 }
2862
2863 -static int add_clone(int argc, const char **argv, const char *prefix)
2864 -{
2865 - int force = 0, quiet = 0, dissociate = 0, progress = 0;
2866 - struct add_data add_data = ADD_DATA_INIT;
2867 -
2868 - struct option options[] = {
2869 - OPT_STRING('b', "branch", &add_data.branch,
2870 - N_("branch"),
2871 - N_("branch of repository to checkout on cloning")),
2872 - OPT_STRING(0, "prefix", &prefix,
2873 - N_("path"),
2874 - N_("alternative anchor for relative paths")),
2875 - OPT_STRING(0, "path", &add_data.sm_path,
2876 - N_("path"),
2877 - N_("where the new submodule will be cloned to")),
2878 - OPT_STRING(0, "name", &add_data.sm_name,
2879 - N_("string"),
2880 - N_("name of the new submodule")),
2881 - OPT_STRING(0, "url", &add_data.realrepo,
2882 - N_("string"),
2883 - N_("url where to clone the submodule from")),
2884 - OPT_STRING(0, "reference", &add_data.reference_path,
2885 - N_("repo"),
2886 - N_("reference repository")),
2887 - OPT_BOOL(0, "dissociate", &dissociate,
2888 - N_("use --reference only while cloning")),
2889 - OPT_INTEGER(0, "depth", &add_data.depth,
2890 - N_("depth for shallow clones")),
2891 - OPT_BOOL(0, "progress", &progress,
2892 - N_("force cloning progress")),
2893 - OPT__FORCE(&force, N_("allow adding an otherwise ignored submodule path"),
2894 - PARSE_OPT_NOCOMPLETE),
2895 - OPT__QUIET(&quiet, "suppress output for cloning a submodule"),
2896 - OPT_END()
2897 - };
2898 -
2899 - const char *const usage[] = {
2900 - N_("git submodule--helper add-clone [<options>...] "
2901 - "--url <url> --path <path> --name <name>"),
2902 - NULL
2903 - };
2904 -
2905 - argc = parse_options(argc, argv, prefix, options, usage, 0);
2906 -
2907 - if (argc != 0)
2908 - usage_with_options(usage, options);
2909 -
2910 - add_data.prefix = prefix;
2911 - add_data.progress = !!progress;
2912 - add_data.dissociate = !!dissociate;
2913 - add_data.force = !!force;
2914 - add_data.quiet = !!quiet;
2915 -
2916 - if (add_submodule(&add_data))
2917 - return 1;
2918 -
2919 - return 0;
2920 -}
2921 -
2863 static int config_submodule_in_gitmodules(const char *name, const char *var, const char *value)
2864 {
2865 char *key;
@@ -3221,7 +3162,6 @@ static struct cmd_struct commands[] = {
3162 {"list", module_list, 0},
3163 {"name", module_name, 0},
3164 {"clone", module_clone, 0},
3224 - {"add-clone", add_clone, 0},
3165 {"add-config", add_config, 0},
3166 {"add", module_add, SUPPORT_SUPER_PREFIX},
3167 {"update-module-mode", module_update_module_mode, 0},