Code

Teach git-submodule.sh about the .git file
authorLars Hjemli <hjemli@gmail.com>
Wed, 20 Feb 2008 22:13:15 +0000 (23:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Apr 2008 08:22:50 +0000 (01:22 -0700)
When git-submodule tries to detect 'active' submodules, it checks for the
existence of a directory named '.git'. This isn't good enough now that .git
can be a file pointing to the real $GIT_DIR so the tests are changed to
reflect this.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-submodule.sh

index 56ec3536e0c40190329b9867b46e36753f30efb2..5bff86022ca80e06ad170e35377bfe94890f41d4 100755 (executable)
@@ -300,7 +300,7 @@ cmd_update()
                        continue
                fi
 
-               if ! test -d "$path"/.git
+               if ! test -d "$path"/.git -o -f "$path"/.git
                then
                        module_clone "$path" "$url" || exit
                        subsha1=
@@ -542,7 +542,7 @@ cmd_status()
        do
                name=$(module_name "$path") || exit
                url=$(git config submodule."$name".url)
-               if test -z "$url" || ! test -d "$path"/.git
+               if test -z "$url" || ! test -d "$path"/.git -o -f "$path"/.git
                then
                        say "-$sha1 $path"
                        continue;