git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Levedahl <mlevedahl@gmail.com>
To: git@vger.kernel.org
Cc: Mark Levedahl <mlevedahl@gmail.com>
Subject: [PATCH] git-submodule.sh - Remove trailing / from URL if found
Date: Tue, 19 Aug 2008 22:18:23 -0400	[thread overview]
Message-ID: <1219198703-2388-1-git-send-email-mlevedahl@gmail.com> (raw)

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>
---
 git-submodule.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-submodule.sh b/git-submodule.sh
index ea6357b..fa9dd3a 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -34,7 +34,7 @@ resolve_relative_url ()
 	remote=$(get_default_remote)
 	remoteurl=$(git config "remote.$remote.url") ||
 		die "remote ($remote) does not have a url in .git/config"
-	url="$1"
+	url="${1%/}"
 	while test -n "$url"
 	do
 		case "$url" in
-- 
1.6.0.22.g2957

             reply	other threads:[~2008-08-20  2:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20  2:18 Mark Levedahl [this message]
2008-08-20  4:07 ` [PATCH] git-submodule.sh - Remove trailing / from URL if found Junio C Hamano
2008-08-21  1:07   ` Mark Levedahl
2008-08-21  3:26     ` Junio C Hamano
2008-08-21 12:04       ` Mark Levedahl
2008-08-21 18:00         ` Junio C Hamano
2008-08-21 23:54           ` Mark Levedahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1219198703-2388-1-git-send-email-mlevedahl@gmail.com \
    --to=mlevedahl@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).