]> git.ipfire.org Git - thirdparty/git.git/commitdiff
submodule--helper: remove --prefix from "absorbgitdirs"
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 8 Nov 2022 14:10:38 +0000 (15:10 +0100)
committerTaylor Blau <me@ttaylorr.com>
Tue, 8 Nov 2022 19:55:30 +0000 (14:55 -0500)
Let's pass the "-C <prefix>" option instead to "absorbgitdirs" from
its only caller.

When it was added in f6f85861400 (submodule: add absorb-git-dir
function, 2016-12-12) there were other "submodule--helper" subcommands
that were invoked with "-C <prefix>", so we could have done this all
along.

Suggested-by: Glen Choo <chooglen@google.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
builtin/submodule--helper.c
git-submodule.sh

index 33f099dbc86214d63565ff17e500115470818d1d..fefedcf8097053eb689fe31f8315def47c6a5530 100644 (file)
@@ -2831,9 +2831,6 @@ static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
        struct pathspec pathspec = { 0 };
        struct module_list list = MODULE_LIST_INIT;
        struct option embed_gitdir_options[] = {
-               OPT_STRING(0, "prefix", &prefix,
-                          N_("path"),
-                          N_("path into the working tree")),
                OPT_END()
        };
        const char *const git_submodule_helper_usage[] = {
index 5e5d21c010f7d4337dbf95cd50eeaf8c97791ba8..d359f171379cab7b8d7a81042bf961ccc356240a 100755 (executable)
@@ -557,7 +557,7 @@ cmd_sync()
 
 cmd_absorbgitdirs()
 {
-       git submodule--helper absorbgitdirs --prefix "$wt_prefix" "$@"
+       git ${wt_prefix:+-C "$wt_prefix"} submodule--helper absorbgitdirs "$@"
 }
 
 # This loop parses the command line arguments to find the