X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-submodule.sh;h=82ac28fa27dc41b821905f1a83155994d56c4f3b;hb=b52e985a4f824128d01220473b04057a4876060d;hp=4aaaaab0d8450094efb8d2f8e82cc63383b91b48;hpb=fed276e7524d6a80ae5dec037d586bd28543fc79;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' )