@matheusbsbs / matheus-bagliano / commits / 7c69561986
Fork 0

git-submodule.sh - Remove trailing / from URL if found

git clone does not complain if a trailing '/' is included in the origin URL, but doing so causes resolution of a submodule's URL relative to the superproject to fail. Regardless of whether git is changed to remove the trailing / before recording the URL, we should avoid this issue in submodule as existing repositories can have this problem. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark Levedahl committed Aug 19, 2008 at 22:18 UTC 7c695619868d0b867c87b0bb83303e058e010ac5
1 file changed +1 -1
git-submodule.sh
+1 -1
@@ -35,7 +35,7 @@ resolve_relative_url ()
35 remote="${remote:-origin}"
36 remoteurl=$(git config "remote.$remote.url") ||
37 die "remote ($remote) does not have a url defined in .git/config"
38 - url="$1"
38 + url="${1%/}"
39 while test -n "$url"
40 do
41 case "$url" in