提交 f53423b0 编写于 作者: K Kevin Ballard 提交者: Junio C Hamano

git-fetch: Don't trigger a bus error when given the refspec "tag"

When git-fetch encounters the refspec "tag" it assumes that the next
argument will be a tag name. If there is no next argument, it should
die gracefully instead of erroring.
Signed-off-by: NKevin Ballard <kevin@sb.org>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 4ed4a347
......@@ -637,6 +637,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (!strcmp(argv[i], "tag")) {
char *ref;
i++;
if (i >= argc)
die("You need to specify a tag name.");
ref = xmalloc(strlen(argv[i]) * 2 + 22);
strcpy(ref, "refs/tags/");
strcat(ref, argv[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册