]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule--helper: accept '-i' shorthand for update --init
authorDominique Martinet <dominique.martinet@atmark-techno.com>
Wed, 8 Jul 2026 03:33:42 +0000 (03:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 8 Jul 2026 17:48:46 +0000 (10:48 -0700)
commit 3ad0ba722744 ("git-submodule.sh: improve variables readability")
made `git submodules update -i` pass `-i` as is to submodule--helper,
but it fails with `error: unknown switch `i'` because the helper does
not accept the short option.

All other short options supported by git-submodule.sh are properly
handle in the helper, so also add the alias for --init

Fixes: 3ad0ba722744 ("git-submodule.sh: improve variables readability")
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c

index 1cc82a134db22e35e095dae1602953f0a48ec2de..3ec8bf50532ea520b76c389494f864009e5ced44 100644 (file)
@@ -2990,7 +2990,7 @@ static int module_update(int argc, const char **argv, const char *prefix,
        struct option module_update_options[] = {
                OPT__SUPER_PREFIX(&opt.super_prefix),
                OPT__FORCE(&opt.force, N_("force checkout updates"), 0),
-               OPT_BOOL(0, "init", &opt.init,
+               OPT_BOOL('i', "init", &opt.init,
                         N_("initialize uninitialized submodules before update")),
                OPT_BOOL(0, "remote", &opt.remote,
                         N_("use SHA-1 of submodule's remote tracking branch")),