Code

http-fetch: do not SEGV after fetching a bad pack idx file
[git.git] / git-submodule.sh
index 3eb78cc724187998aa9ecf71509325631b8668c9..099a7d7560879c284c9fb2fff68f4588baaaf49b 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