X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-submodule.sh;h=82ac28fa27dc41b821905f1a83155994d56c4f3b;hb=694a577519a762d12b8a53e76b6f1dd3ccf25e7d;hp=4aaaaab0d8450094efb8d2f8e82cc63383b91b48;hpb=e75c55844fd0ff96d00173574b1e49cc472ca928;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index 4aaaaab0d..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' )