Code

Fix submodule sync with relative submodule URLs
authorJohan Herland <johan@herland.net>
Mon, 22 Sep 2008 16:08:31 +0000 (18:08 +0200)
committerShawn O. Pearce <spearce@spearce.org>
Thu, 25 Sep 2008 15:11:03 +0000 (08:11 -0700)
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-submodule.sh

index 1c39b593a628cc94d24d227cc5d92e00ac5e71ed..92be0feb5840c055061f680a45eef6c8f4ebda2d 100755 (executable)
@@ -634,6 +634,14 @@ cmd_sync()
        do
                name=$(module_name "$path")
                url=$(git config -f .gitmodules --get submodule."$name".url)
+
+               # Possibly a url relative to parent
+               case "$url" in
+               ./*|../*)
+                       url=$(resolve_relative_url "$url") || exit
+                       ;;
+               esac
+
                if test -e "$path"/.git
                then
                (