aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:54 -0700
committerJunio C Hamano <gitster@pobox.com>2015-08-19 14:48:54 -0700
commit8259da5ea3d993aa8b783a5039f5a78d86312c65 (patch)
tree9318fd6f06cd48d8b07c1bbe864fa78a4de5c199 /builtin
parent824a0be6be8d6c3323003bae65b3df98387e575b (diff)
parentdb2e220447f7b02278d64417c8f05f73710f5b8b (diff)
downloadgit-8259da5ea3d993aa8b783a5039f5a78d86312c65.tar.gz
git-8259da5ea3d993aa8b783a5039f5a78d86312c65.tar.xz
Merge branch 'jk/guess-repo-name-regression-fix'
"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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 303a3a7eb..bf451995a 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);