Skip to content

Commit

Permalink
git-show-ref --verify: Fail if called without a reference
Browse files Browse the repository at this point in the history
builtin-show-ref.c (cmd_show_ref): Fail if called with --verify option but
without a reference.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Dmitry V. Levin authored and Junio C Hamano committed Feb 24, 2007
1 parent 75b62b4 commit 8ab40a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions builtin-show-ref.c
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 8ab40a2

Please sign in to comment.