Re: [PATCH] submodule: fix relative url parsing for scp-style origin
- From
Thomas Rast <trast@student.ethz.ch>
- Date
- Jan 10, 2011, 17:05 UTC
- Message-ID
- <201101101805.13251.trast@student.ethz.ch>
- In-Reply-To
- <20110110164801.GA7714@burratino>
Jonathan Nieder wrote:
Show 14 quoted lines
> Thomas Rast wrote:
> > + case "$remoteurl" in
> > + */*)
> > + remoteurl="${remoteurl%/*}"
> > + ;;
> > + *:*)
> > + remoteurl="${remoteurl%:*}"
> > + sep=:
> > + ;;
>
> What happens to
>
> url = ssh://example.com:1234
> url = ftp://ftp.example.comNeither specifies a repo, unless you count "the default dir on the remote side" (do we support that?). The existing code would have snipped at the / and constructed something like ssh:/otherrepo.
> url = /local/path/with/a/colon:in:it > url = git://example.com/path/with/a/colon:in:it
These work fine because the first case arm is "do we still have a slash?", and thus takes precedence over the colon splitting.
> url = simple.subdir.of.cwd
That's caught by the outer 'case':
case "$url" in
../*)
url="${url#../}"
# ... what we're discussing here
;;
./*)
url="${url#./}"
;;
*)
break;;--
Thomas Rast
trast@{inf,student}.ethz.ch