X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-submodule.sh;h=82ac28fa27dc41b821905f1a83155994d56c4f3b;hb=faf8280850e9af4ef63decd8d4e65a7609544c21;hp=727b1d3206da6964affe80d92699cd39c1878e34;hpb=2af89f12c666634e92cd79a6c1af6acc34104c34;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index 727b1d320..82ac28fa2 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -5,6 +5,7 @@ # Copyright (c) 2007 Lars Hjemli USAGE='[--quiet] [--cached] [add [-b branch]|status|init|update] [--] [...]' +OPTIONS_SPEC= . git-sh-setup require_work_tree @@ -73,7 +74,7 @@ resolve_relative_url () module_name() { # Do we have "submodule..path = $1" defined in .gitmodules file? - re=$(printf '%s' "$1" | sed -e 's/\([^a-zA-Z0-9_]\)/\\\1/g') + re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g') name=$( GIT_CONFIG=.gitmodules \ git config --get-regexp '^submodule\..*\.path$' | sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' ) @@ -138,8 +139,8 @@ module_add() # it is local if base=$(get_repo_base "$repo"); then repo="$base" - realrepo=$repo fi + realrepo=$repo ;; esac