diff --git a/builtin/clone.c b/builtin/clone.c index c68eae13bf..f60d3271ed 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -215,6 +215,10 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare) len = end - start; strip_suffix_mem(start, &len, is_bundle ? ".bundle" : ".git"); + if (!len || (len == 1 && *start == '/')) + die("No directory name could be guessed.\n" + "Please specify a directory on the command line"); + if (is_bare) dir = xstrfmt("%.*s.git", (int)len, start); else