]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-submodule.sh
Merge branch 'ag/rewrite_one' into maint
[git.git] / git-submodule.sh
index 3eb78cc724187998aa9ecf71509325631b8668c9..21e5b5b7daf341a59b9496b235adcceafe4f2c8c 100755 (executable)
@@ -167,8 +167,7 @@ cmd_add()
        # perhaps the path exists and is already a git repo, else clone it
        if test -e "$path"
        then
-               if test -d "$path/.git" &&
-               test "$(unset GIT_DIR; cd $path; git rev-parse --git-dir)" = ".git"
+               if test -d "$path"/.git -o -f "$path"/.git
                then
                        echo "Adding existing repo at '$path' to the index"
                else
@@ -270,6 +269,7 @@ cmd_update()
        do
                case "$1" in
                -q|--quiet)
+                       shift
                        quiet=1
                        ;;
                -i|--init)
@@ -287,7 +287,6 @@ cmd_update()
                        break
                        ;;
                esac
-               shift
        done
 
        git ls-files --stage -- "$@" | grep '^160000 ' |