From: Dmitry V. Levin Date: Fri, 23 Feb 2007 17:12:33 +0000 (+0300) Subject: git-show-ref --verify: Fail if called without a reference X-Git-Tag: v1.5.0.2~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8ab40a20053aa4a0f8d92d08ece88ff09b771435;p=git.git 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: Dmitry V. Levin Signed-off-by: Junio C Hamano --- diff --git a/builtin-show-ref.c b/builtin-show-ref.c index 853f13f6a..75211e64f 100644 --- a/builtin-show-ref.c +++ b/builtin-show-ref.c @@ -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)