diff --git a/git-submodule.sh b/git-submodule.sh
index 1c656be1cfb6eb7d63e6a1f3cdda959cf90aca89..82ac28fa27dc41b821905f1a83155994d56c4f3b 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
module_name()
{
# Do we have "submodule.<something>.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' )