submodule--helper: remove add-config subcommand

Also no longer needed is 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 ba8a3b019ed796fcf5224c2b2280eb1ebc129075
1 file changed -49
builtin/submodule--helper.c
-49
@@ -2940,54 +2940,6 @@ static void configure_added_submodule(struct add_data *add_data)
2940 }
2941 }
2942
2943 -static int add_config(int argc, const char **argv, const char *prefix)
2944 -{
2945 - int force = 0;
2946 - struct add_data add_data = ADD_DATA_INIT;
2947 -
2948 - struct option options[] = {
2949 - OPT_STRING('b', "branch", &add_data.branch,
2950 - N_("branch"),
2951 - N_("branch of repository to store in "
2952 - "the submodule configuration")),
2953 - OPT_STRING(0, "url", &add_data.repo,
2954 - N_("string"),
2955 - N_("url to clone submodule from")),
2956 - OPT_STRING(0, "resolved-url", &add_data.realrepo,
2957 - N_("string"),
2958 - N_("url to clone the submodule from, after it has "
2959 - "been dereferenced relative to parent's url, "
2960 - "in the case where <url> is a relative url")),
2961 - OPT_STRING(0, "path", &add_data.sm_path,
2962 - N_("path"),
2963 - N_("where the new submodule will be cloned to")),
2964 - OPT_STRING(0, "name", &add_data.sm_name,
2965 - N_("string"),
2966 - N_("name of the new submodule")),
2967 - OPT__FORCE(&force, N_("allow adding an otherwise ignored submodule path"),
2968 - PARSE_OPT_NOCOMPLETE),
2969 - OPT_END()
2970 - };
2971 -
2972 - const char *const usage[] = {
2973 - N_("git submodule--helper add-config "
2974 - "[--force|-f] [--branch|-b <branch>] "
2975 - "--url <url> --resolved-url <resolved-url> "
2976 - "--path <path> --name <name>"),
2977 - NULL
2978 - };
2979 -
2980 - argc = parse_options(argc, argv, prefix, options, usage, 0);
2981 -
2982 - if (argc)
2983 - usage_with_options(usage, options);
2984 -
2985 - add_data.force = !!force;
2986 - configure_added_submodule(&add_data);
2987 -
2988 - return 0;
2989 -}
2990 -
2943 static void die_on_index_match(const char *path, int force)
2944 {
2945 struct pathspec ps;
@@ -3162,7 +3114,6 @@ static struct cmd_struct commands[] = {
3114 {"list", module_list, 0},
3115 {"name", module_name, 0},
3116 {"clone", module_clone, 0},
3165 - {"add-config", add_config, 0},
3117 {"add", module_add, SUPPORT_SUPER_PREFIX},
3118 {"update-module-mode", module_update_module_mode, 0},
3119 {"update-clone", update_clone, 0},