Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-05 Thread Jeff King
On Wed, Aug 05, 2015 at 11:06:03AM +0200, Patrick Steinhardt wrote: > You're welcome. And yes, your tests help me quite a lot here. Got > tedious to always set up the chroot. Guess I'll still send my > fixes for the chroot-tests as a separate patch series, even > though I don't require them anymor

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-05 Thread Patrick Steinhardt
On Wed, Aug 05, 2015 at 04:41:48AM -0400, Jeff King wrote: > On Wed, Aug 05, 2015 at 08:08:52AM +0200, Patrick Steinhardt wrote: > > > > Sadly we cannot just `strip_suffix_mem(repo, &len, "/.git"))` in the > > > earlier code, as we have to account for multiple directory separators. I > > > believe

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-05 Thread Jeff King
On Wed, Aug 05, 2015 at 08:08:52AM +0200, Patrick Steinhardt wrote: > > Sadly we cannot just `strip_suffix_mem(repo, &len, "/.git"))` in the > > earlier code, as we have to account for multiple directory separators. I > > believe the above code does the right thing, though. I haven't looked at > >

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-04 Thread Patrick Steinhardt
On Tue, Aug 04, 2015 at 06:42:46PM -0400, Jeff King wrote: > On Tue, Aug 04, 2015 at 09:31:18AM +0200, Sebastian Schuberth wrote: [snip] > Sadly we cannot just `strip_suffix_mem(repo, &len, "/.git"))` in the > earlier code, as we have to account for multiple directory separators. I > believe the ab

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-04 Thread Jeff King
On Tue, Aug 04, 2015 at 09:31:18AM +0200, Sebastian Schuberth wrote: > On Tue, Aug 4, 2015 at 6:34 AM, Lukas Fleischer wrote: > > > I am currently on vacation and cannot bisect or debug this but I am > > pretty confident that this patch changes the behaviour of directory name > > guessing. With

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-04 Thread Sebastian Schuberth
On Tue, Aug 4, 2015 at 6:34 AM, Lukas Fleischer wrote: > I am currently on vacation and cannot bisect or debug this but I am > pretty confident that this patch changes the behaviour of directory name > guessing. With Git 2.4.6, cloning http://foo.bar/foo.git/ results in a > directory named foo an

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-03 Thread Lukas Fleischer
On Thu, 09 Jul 2015 at 20:24:08, Sebastian Schuberth wrote: > Signed-off-by: Sebastian Schuberth > --- > builtin/clone.c | 17 + > 1 file changed, 5 insertions(+), 12 deletions(-) > > diff --git a/builtin/clone.c b/builtin/clone.c > index 00535d0..ebcb849 100644 > --- a/builtin/c

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-07-09 Thread Sebastian Schuberth
On Thu, Jul 9, 2015 at 11:21 PM, Junio C Hamano wrote: >> - if (is_bare) { >> - struct strbuf result = STRBUF_INIT; >> - strbuf_addf(&result, "%.*s.git", (int)(end - start), start); >> - dir = strbuf_detach(&result, NULL); >> - } else >> + if (is_ba

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-07-09 Thread Junio C Hamano
Sebastian Schuberth writes: > - if (is_bare) { > - struct strbuf result = STRBUF_INIT; > - strbuf_addf(&result, "%.*s.git", (int)(end - start), start); > - dir = strbuf_detach(&result, NULL); > - } else > + if (is_bare) > + dir = xstrfmt

[PATCH v4] clone: simplify string handling in guess_dir_name()

2015-07-09 Thread Sebastian Schuberth
Signed-off-by: Sebastian Schuberth --- builtin/clone.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 00535d0..ebcb849 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -147,6 +147,7 @@ static char *get_repo_path(