submodule--helper: remove --prefix from "absorbgitdirs"

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>

Ævar Arnfjörð Bjarmason committed Nov 8, 2022 at 15:10 UTC 64f48ad1f036be2a09273051b28bfacf471cbfcc
2 files changed +1 -4
builtin/submodule--helper.c
-3
@@ -2831,9 +2831,6 @@ static int absorb_git_dirs(int argc, const char **argv, const char *prefix)
2831 struct pathspec pathspec = { 0 };
2832 struct module_list list = MODULE_LIST_INIT;
2833 struct option embed_gitdir_options[] = {
2834 - OPT_STRING(0, "prefix", &prefix,
2835 - N_("path"),
2836 - N_("path into the working tree")),
2834 OPT_END()
2835 };
2836 const char *const git_submodule_helper_usage[] = {
git-submodule.sh
+1 -1
@@ -557,7 +557,7 @@ cmd_sync()
557
558 cmd_absorbgitdirs()
559 {
560 - git submodule--helper absorbgitdirs --prefix "$wt_prefix" "$@"
560 + git ${wt_prefix:+-C "$wt_prefix"} submodule--helper absorbgitdirs "$@"
561 }
562
563 # This loop parses the command line arguments to find the