From 64f48ad1f036be2a09273051b28bfacf471cbfcc Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Tue, 8 Nov 2022 15:10:38 +0100 Subject: submodule--helper: remove --prefix from "absorbgitdirs" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's pass the "-C " 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 ", so we could have done this all along. Suggested-by: Glen Choo Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Taylor Blau --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-submodule.sh') diff --git a/git-submodule.sh b/git-submodule.sh index 5e5d21c010..d359f17137 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -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 -- cgit v1.2.3 From 1b6e2001c7fd96214b1fe2f910fad5cbb60b607a Mon Sep 17 00:00:00 2001 From: Ævar Arnfjörð Bjarmason Date: Tue, 8 Nov 2022 15:10:39 +0100 Subject: submodule--helper: drop "update --prefix " for "-C update" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 29a5e9e1ffe (submodule--helper update-clone: learn --init, 2022-03-04) we've been passing "-C " from "git-submodule.sh" whenever we pass "--prefix ", so the latter is redundant to the former. Let's drop the "--prefix" option. Suggested-by: Glen Choo Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Taylor Blau --- builtin/submodule--helper.c | 4 +--- git-submodule.sh | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'git-submodule.sh') diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index fefedcf809..03d1b58aca 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -2643,9 +2643,6 @@ static int module_update(int argc, const char **argv, const char *prefix) N_("traverse submodules recursively")), OPT_BOOL('N', "no-fetch", &opt.nofetch, N_("don't fetch new objects from the remote site")), - OPT_STRING(0, "prefix", &opt.prefix, - N_("path"), - N_("path into the working tree")), OPT_SET_INT(0, "checkout", &opt.update_default, N_("use the 'checkout' update strategy (default)"), SM_UPDATE_CHECKOUT), @@ -2701,6 +2698,7 @@ static int module_update(int argc, const char **argv, const char *prefix) } opt.filter_options = &filter_options; + opt.prefix = prefix; if (opt.update_default) opt.update_strategy.type = opt.update_default; diff --git a/git-submodule.sh b/git-submodule.sh index d359f17137..9a50f2e912 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -343,7 +343,6 @@ cmd_update() ${recursive:+--recursive} \ ${init:+--init} \ ${nofetch:+--no-fetch} \ - ${wt_prefix:+--prefix "$wt_prefix"} \ ${rebase:+--rebase} \ ${merge:+--merge} \ ${checkout:+--checkout} \ -- cgit v1.2.3