Skip to content

Commit

Permalink
builtin-verify-tag: fix -v option parsing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Olivier Marin authored and Junio C Hamano committed Jul 29, 2008
1 parent 7ddea13 commit d276189
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions builtin-verify-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d276189

Please sign in to comment.