Re: [PATCH v7 09/20] submodule--helper: remove update-module-mode
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Feb 12, 2022, 14:35 UTC
- Message-ID
- <220212.86tud4xicm.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20220210092833.55360-10-chooglen@google.com>
On Thu, Feb 10 2022, Glen Choo wrote:
Show 50 quoted lines
> This is dead code - it has not been used since c51f8f94e5
> (submodule--helper: run update procedures from C, 2021-08-24).
>
> Signed-off-by: Glen Choo <chooglen@google.com>
> ---
> builtin/submodule--helper.c | 24 ------------------------
> 1 file changed, 24 deletions(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 4a0890954e..e0cc1c1b79 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -1965,29 +1965,6 @@ static void determine_submodule_update_strategy(struct repository *r,
> free(key);
> }
>
> -static int module_update_module_mode(int argc, const char **argv, const char *prefix)
> -{
> - const char *path, *update = NULL;
> - int just_cloned;
> - struct submodule_update_strategy update_strategy = { .type = SM_UPDATE_CHECKOUT };
> -
> - if (argc < 3 || argc > 4)
> - die("submodule--helper update-module-clone expects <just-cloned> <path> [<update>]");
> -
> - just_cloned = git_config_int("just_cloned", argv[1]);
> - path = argv[2];
> -
> - if (argc == 4)
> - update = argv[3];
> -
> - determine_submodule_update_strategy(the_repository,
> - just_cloned, path, update,
> - &update_strategy);
> - fputs(submodule_strategy_to_string(&update_strategy), stdout);
> -
> - return 0;
> -}
> -
> struct update_clone_data {
> const struct submodule *sub;
> struct object_id oid;
> @@ -3388,7 +3365,6 @@ static struct cmd_struct commands[] = {
> {"name", module_name, 0},
> {"clone", module_clone, 0},
> {"add", module_add, SUPPORT_SUPER_PREFIX},
> - {"update-module-mode", module_update_module_mode, 0},
> {"update-clone", update_clone, 0},
> {"run-update-procedure", run_update_procedure, 0},
> {"ensure-core-worktree", ensure_core_worktree, 0},Nice catch!
Re my comment on 04/20 in <220212.86y22gxig0.gmgdl@evledraar.gmail.com> at least 04..09/20 could be split into such a "trivial refactors for later changes" series, and it would make sense to lead with this (and any other deletions of already-dead code).