summaryrefslogtreecommitdiff
path: root/builtin-show-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-show-ref.c')
-rw-r--r--builtin-show-ref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin-show-ref.c b/builtin-show-ref.c
index ae0edddac1..9463ff0e69 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 (!prefixcmp(*pattern, "refs/") &&
resolve_ref(*pattern, sha1, 1, NULL)) {
if (!quiet)