diff --git a/git-submodule.sh b/git-submodule.sh
index 727b1d3206da6964affe80d92699cd39c1878e34..82ac28fa27dc41b821905f1a83155994d56c4f3b 100755 (executable)
--- a/git-submodule.sh
+++ b/git-submodule.sh
# Copyright (c) 2007 Lars Hjemli
USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update] [--] [<path>...]'
# Copyright (c) 2007 Lars Hjemli
USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update] [--] [<path>...]'
+OPTIONS_SPEC=
. git-sh-setup
require_work_tree
. git-sh-setup
require_work_tree
module_name()
{
# Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
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' )
name=$( GIT_CONFIG=.gitmodules \
git config --get-regexp '^submodule\..*\.path$' |
sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
# it is local
if base=$(get_repo_base "$repo"); then
repo="$base"
# it is local
if base=$(get_repo_base "$repo"); then
repo="$base"
- realrepo=$repo
fi
fi
+ realrepo=$repo
;;
esac
;;
esac