{"thread":{"id":"6929","subject":"[PATCH] git-show-ref --verify: Fail if called without a reference","startedAt":"2007-02-23T17:12:33Z","lastAt":"2007-02-23T17:12:33Z","messageCount":1,"participants":["Dmitry V. Levin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"35334","messageId":"20070223171232.GA3936@nomad.office.altlinux.org","threadId":"6929","inReplyTo":null,"subject":"[PATCH] git-show-ref --verify: Fail if called without a reference","fromName":"Dmitry V. Levin","fromEmail":"ldv@altlinux.org","sentAt":"2007-02-23T17:12:33Z","receivedAt":"2007-02-23T17:12:33Z","isPatch":true,"sender":{"key":"ldv@altlinux.org","avatar":"https://avatars.githubusercontent.com/u/5281408?v=4"},"body":"builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but\nwithout a reference.\n\nSigned-off-by: Dmitry V. Levin <ldv@altlinux.org>\n---\n builtin-show-ref.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin-show-ref.c b/builtin-show-ref.c\nindex 853f13f..75211e6 100644\n--- a/builtin-show-ref.c\n+++ b/builtin-show-ref.c\n@@ -221,9 +221,11 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)\n \t}\n \n \tif (verify) {\n-\t\tunsigned char sha1[20];\n-\n+\t\tif (!pattern)\n+\t\t\tdie(\"--verify requires a reference\");\n \t\twhile (*pattern) {\n+\t\t\tunsigned char sha1[20];\n+\n \t\t\tif (!strncmp(*pattern, \"refs/\", 5) &&\n \t\t\t    resolve_ref(*pattern, sha1, 1, NULL)) {\n \t\t\t\tif (!quiet)\n-- \n1.5.0.1.GIT\n"}]}