checkout: mention '--' in the docs
[gitweb.git] / git-submodule.sh
index c2ce2fbe8afa924f7f34970a3fb07363abe07452..b40f876a2ca9fe985cedc622ab28a9f461edc5ab 100755 (executable)
@@ -172,6 +172,16 @@ cmd_add()
                else
                        die "'$path' already exists and is not a valid git repo"
                fi
+
+               case "$repo" in
+               ./*|../*)
+                       url=$(resolve_relative_url "$repo") || exit
+                   ;;
+               *)
+                       url="$repo"
+                       ;;
+               esac
+               git config submodule."$path".url "$url"
        else
 
                module_clone "$path" "$realrepo" || exit
@@ -254,6 +264,7 @@ cmd_update()
        do
                case "$1" in
                -q|--quiet)
+                       shift
                        quiet=1
                        ;;
                -i|--init)
@@ -271,7 +282,6 @@ cmd_update()
                        break
                        ;;
                esac
-               shift
        done
 
        git ls-files --stage -- "$@" | grep '^160000 ' |