X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-submodule.sh;h=92be0feb5840c055061f680a45eef6c8f4ebda2d;hb=d22d53db6550d9acc773c3896869cba812f7afb5;hp=4a95035d85d7563b84df15a09dc7c8160e9864ca;hpb=bb0d283989ec8853ffd72dfb26ff557ffa7781e4;p=git.git diff --git a/git-submodule.sh b/git-submodule.sh index 4a95035d8..92be0feb5 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -35,6 +35,7 @@ resolve_relative_url () remoteurl=$(git config "remote.$remote.url") || die "remote ($remote) does not have a url defined in .git/config" url="$1" + remoteurl=${remoteurl%/} while test -n "$url" do case "$url" in @@ -49,7 +50,7 @@ resolve_relative_url () break;; esac done - echo "$remoteurl/$url" + echo "$remoteurl/${url%/}" } # @@ -633,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 (