diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-25 16:09:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-25 16:09:17 -0700 |
commit | 52f6893d356fd04ba350e5b7dd468b2181844521 (patch) | |
tree | 25d5b368e419ae85210c94d94efdef6a157ca794 /builtin | |
parent | 84deb3eac542cee2542e48de31c66383fbe3fc8d (diff) | |
parent | db2e220447f7b02278d64417c8f05f73710f5b8b (diff) | |
download | git-52f6893d356fd04ba350e5b7dd468b2181844521.tar.gz |
Merge branch 'jk/guess-repo-name-regression-fix' into maint
"git clone $URL" in recent releases of Git contains a regression in
the code that invents a new repository name incorrectly based on
the $URL. This has been corrected.
* jk/guess-repo-name-regression-fix:
clone: use computed length in guess_dir_name
clone: add tests for output directory
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/clone.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index a72ff7e009..53cf545c5e 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -174,7 +174,8 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare) /* * Strip .{bundle,git}. */ - strip_suffix(start, is_bundle ? ".bundle" : ".git" , &len); + len = end - start; + strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git"); if (is_bare) dir = xstrfmt("%.*s.git", (int)len, start); |