Re: Bug with URL-decoding
- From
Jeff King <peff@peff.net>
- Date
- May 23, 2010, 09:16 UTC
- Message-ID
- <20100523091612.GB26123@coredump.intra.peff.net>
- In-Reply-To
- <loom.20100507T000406-241@post.gmane.org>
On Thu, May 06, 2010 at 10:06:50PM +0000, Dave Abrahams wrote:
Show 9 quoted lines
> $ cd /tmp > $ mkdir x+y > $ cd x+y > $ git init > $ cd .. > $ git clone file:///tmp/x%2By zz # <==== ERROR > $ git clone file:///tmp/x+y zz # <====== OK > > Funny characters do come up in names, especially in test suites
Yeah, at this point file:// is more or less just an alias for a straight path (and ssh:// an alias for "host:path" syntax). We correctly percent-decode http:// URLs because we just hand them to curl, which does the right thing. We should be decoding these ones when we pick apart the URL components.
Patch series to follow:
[1/2]: make url-related functions reusable [2/2]: decode file:// and ssh:// URLs
With these patches, you can do:
git clone file:///tmp/x%2By
or
git clone /tmp/x+y
The former will clone into "x%2By". Which I'm not even sure is wrong, so I left it as-is.
-Peff