Re: [PATCH] clone: allow cloning local paths with colons in them

2013-04-27 Thread Duy Nguyen
On Sun, Apr 28, 2013 at 8:48 AM, Eric Sunshine wrote: > On Sat, Apr 27, 2013 at 8:19 PM, Duy Nguyen wrote: >> On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano wrote: >>> That was fairly hard to grok. Is that equivalent to this? >>> >>> if (c == ':' && path < strchrnul(host, '/'))

Re: [PATCH] clone: allow cloning local paths with colons in them

2013-04-27 Thread Eric Sunshine
On Sat, Apr 27, 2013 at 8:19 PM, Duy Nguyen wrote: > On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano wrote: >> That was fairly hard to grok. Is that equivalent to this? >> >> if (c == ':' && path < strchrnul(host, '/')) { >> /* is the first slash past the c

Re: [PATCH] clone: allow cloning local paths with colons in them

2013-04-27 Thread Duy Nguyen
On Sun, Apr 28, 2013 at 4:16 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> diff --git a/connect.c b/connect.c >> index f57efd0..b568f10 100644 >> --- a/connect.c >> +++ b/connect.c >> @@ -551,8 +551,11 @@ struct child_process *git_connect(int fd[2], const char >> *url_orig, >>

Re: [PATCH] clone: allow cloning local paths with colons in them

2013-04-27 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > diff --git a/connect.c b/connect.c > index f57efd0..b568f10 100644 > --- a/connect.c > +++ b/connect.c > @@ -551,8 +551,11 @@ struct child_process *git_connect(int fd[2], const char > *url_orig, > path = strchr(end, c); > if (path && !has_dos_drive_pref

Re: [PATCH] clone: allow cloning local paths with colons in them

2013-04-27 Thread William Giokas
On Sat, Apr 27, 2013 at 10:36:18AM +0700, Nguyễn Thái Ngọc Duy wrote: > Usually "foo:bar" is interpreted as an ssh url. This patch allows to > clone from such paths by putting at least one slash before the colon > (i.e. /path/to/foo:bar or just ./foo:bar). > > file://foo:bar should also work, but

[PATCH] clone: allow cloning local paths with colons in them

2013-04-26 Thread Nguyễn Thái Ngọc Duy
Usually "foo:bar" is interpreted as an ssh url. This patch allows to clone from such paths by putting at least one slash before the colon (i.e. /path/to/foo:bar or just ./foo:bar). file://foo:bar should also work, but local optimizations are off in that case, which may be unwanted. While at there,