X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-submodule.sh;h=adaa2a8cc214258450e4268a72006069abaf69a2;hb=9ac92fed5b63176e653c3c42e2b66cdd203c906f;hp=156255a9e56e7a5930f3f652ee38994064db03ea;hpb=706566524ef59a97e89ba895b800398ef823d109;p=thirdparty%2Fgit.git diff --git a/git-submodule.sh b/git-submodule.sh index 156255a9e5..adaa2a8cc2 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -34,6 +34,7 @@ reference= cached= recursive= init= +require_init= files= remote= nofetch= @@ -229,6 +230,11 @@ Use -f if you really want to add it." >&2 sm_name="$sm_path" fi + if ! git submodule--helper check-name "$sm_name" + then + die "$(eval_gettext "'$sm_name' is not a valid submodule name")" + fi + # perhaps the path exists and is already a git repo, else clone it if test -e "$sm_path" then @@ -523,6 +529,10 @@ cmd_update() -i|--init) init=1 ;; + --require-init) + init=1 + require_init=1 + ;; --remote) remote=1 ;; @@ -601,6 +611,7 @@ cmd_update() ${update:+--update "$update"} \ ${reference:+"$reference"} \ ${depth:+--depth "$depth"} \ + ${require_init:+--require-init} \ ${recommend_shallow:+"$recommend_shallow"} \ ${jobs:+$jobs} \ "$@" || echo "#unmatched" $?