]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-submodule.sh
autoconf: Add tests for memmem, strtoumax and mkdtemp functions
[thirdparty/git.git] / git-submodule.sh
index 4aaaaab0d8450094efb8d2f8e82cc63383b91b48..82ac28fa27dc41b821905f1a83155994d56c4f3b 100755 (executable)
@@ -5,6 +5,7 @@
 # Copyright (c) 2007 Lars Hjemli
 
 USAGE='[--quiet] [--cached] [add <repo> [-b branch]|status|init|update] [--] [<path>...]'
+OPTIONS_SPEC=
 . git-sh-setup
 require_work_tree
 
@@ -73,7 +74,7 @@ resolve_relative_url ()
 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' )