提交 adef9561 编写于 作者: P Patrick Steinhardt 提交者: Junio C Hamano

clone: abort if no dir name could be guessed

Due to various components of the URI being stripped off it may
happen that we fail to guess a directory name. We currently error
out with a message that it is impossible to create the working
tree '' in such cases. Instead, error out early with a sensible
error message hinting that a directory name should be specified
manually on the command line.
Signed-off-by: NPatrick Steinhardt <ps@pks.im>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 92722efe
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册