Re: [PATCH] clone: Make use of the strip_suffix() helper method

2015-07-09 Thread Sebastian Schuberth
On Thu, Jul 9, 2015 at 7:00 PM, Jeff King wrote: > If you wanted to get really fancy, I think you could put a ternary > operator in the middle of the strip_suffix call. That makes it clear > that "len" is set in all code paths, but I think some people find > ternary operators unreadable. :) I li

Re: [PATCH] clone: Make use of the strip_suffix() helper method

2015-07-09 Thread Jeff King
On Thu, Jul 09, 2015 at 03:33:46PM +, Sebastian Schuberth wrote: > @@ -174,19 +175,17 @@ static char *guess_dir_name(const char *repo, int > is_bundle, int is_bare) >* Strip .{bundle,git}. >*/ > if (is_bundle) { > - if (end - start > 7 && !strncmp(end - 7, ".

[PATCH] clone: Make use of the strip_suffix() helper method

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