提交 8ab40a20 编写于 作者: D Dmitry V. Levin 提交者: Junio C Hamano

git-show-ref --verify: Fail if called without a reference

builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but
without a reference.
Signed-off-by: NDmitry V. Levin <ldv@altlinux.org>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 75b62b48
......@@ -221,9 +221,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)
}
if (verify) {
unsigned char sha1[20];
if (!pattern)
die("--verify requires a reference");
while (*pattern) {
unsigned char sha1[20];
if (!strncmp(*pattern, "refs/", 5) &&
resolve_ref(*pattern, sha1, 1, NULL)) {
if (!quiet)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册