diff options
author | Olivier Marin <dkr@freesurf.fr> | 2008-07-28 12:48:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-28 23:02:11 -0700 |
commit | d2761895144b6fabcbe1f3bd40d6c6798914b518 (patch) | |
tree | cf1c5a5d33b1bf5e6a6b5fa41dd587822ec1cbde | |
parent | 7ddea13af24d72deca06a779b1827a8ea2d6cfe6 (diff) | |
download | git-d2761895144b6fabcbe1f3bd40d6c6798914b518.tar.gz |
builtin-verify-tag: fix -v option parsing
Since the C rewrite, "git verify-tag -v" just does nothing instead of
printing the usage message with an error. This patch fix the regression.
Signed-off-by: Olivier Marin <dkr@freesurf.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | builtin-verify-tag.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin-verify-tag.c b/builtin-verify-tag.c index 7d837f0f98..729a1593e6 100644 --- a/builtin-verify-tag.c +++ b/builtin-verify-tag.c @@ -92,14 +92,15 @@ int cmd_verify_tag(int argc, const char **argv, const char *prefix) git_config(git_default_config, NULL); - if (argc == 1) - usage(builtin_verify_tag_usage); - - if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose")) { + if (argc > 1 && + (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--verbose"))) { verbose = 1; i++; } + if (argc <= i) + usage(builtin_verify_tag_usage); + /* sometimes the program was terminated because this signal * was received in the process of writing the gpg input: */ signal(SIGPIPE, SIG_IGN); |