| 52 | } |
| 53 | |
| 54 | int cmd_verify_commit(int argc, |
| 55 | const char **argv, |
| 56 | const char *prefix, |
| 57 | struct repository *repo) |
| 58 | { |
| 59 | int i = 1, verbose = 0, had_error = 0; |
| 60 | unsigned flags = 0; |
| 61 | const struct option verify_commit_options[] = { |
| 62 | OPT__VERBOSE(&verbose, N_("print commit contents")), |
| 63 | OPT_BIT(0, "raw", &flags, N_("print raw gpg status output"), GPG_VERIFY_RAW), |
| 64 | OPT_END() |
| 65 | }; |
| 66 | |
| 67 | repo_config(repo, git_default_config, NULL); |
| 68 | |
| 69 | argc = parse_options(argc, argv, prefix, verify_commit_options, |
| 70 | verify_commit_usage, PARSE_OPT_KEEP_ARGV0); |
| 71 | if (argc <= i) |
| 72 | usage_with_options(verify_commit_usage, verify_commit_options); |
| 73 | |
| 74 | if (verbose) |
| 75 | flags |= GPG_VERIFY_VERBOSE; |
| 76 | |
| 77 | /* sometimes the program was terminated because this signal |
| 78 | * was received in the process of writing the gpg input: */ |
| 79 | signal(SIGPIPE, SIG_IGN); |
| 80 | while (i < argc) |
| 81 | if (verify_commit(repo, argv[i++], flags)) |
| 82 | had_error = 1; |
| 83 | return had_error; |
| 84 | } |
nothing calls this directly
no test coverage detected