submodule--helper update-clone: check for --filter and --init

"git submodule update --filter" also requires the "--init" option. Teach
update-clone to do this usage check in C and remove the check from
git-submodule.sh.

In addition, change update-clone's usage string so that it teaches users
about "git submodule update" instead of "git submodule--helper
update-clone" (the string is copied from git-submodule.sh). This should
be more helpful to users since they don't invoke update-clone directly.

Signed-off-by: Glen Choo <chooglen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Glen Choo
2022-03-04 16:14:01 -08:00
committed by Junio C Hamano
parent 104744f91d
commit c9d2562493
2 changed files with 19 additions and 6 deletions

View File

@ -356,11 +356,6 @@ cmd_update()
shift
done
if test -n "$filter" && test "$init" != "1"
then
usage
fi
{
git ${wt_prefix:+-C "$wt_prefix"} submodule--helper update-clone \
${GIT_QUIET:+--quiet} \