| 34 | } |
| 35 | |
| 36 | static int verify_commit(struct repository *repo, const char *name, unsigned flags) |
| 37 | { |
| 38 | struct object_id oid; |
| 39 | struct object *obj; |
| 40 | |
| 41 | if (repo_get_oid(repo, name, &oid)) |
| 42 | return error("commit '%s' not found.", name); |
| 43 | |
| 44 | obj = parse_object(repo, &oid); |
| 45 | if (!obj) |
| 46 | return error("%s: unable to read file.", name); |
| 47 | if (obj->type != OBJ_COMMIT) |
| 48 | return error("%s: cannot verify a non-commit object of type %s.", |
| 49 | name, type_name(obj->type)); |
| 50 | |
| 51 | return run_gpg_verify((struct commit *)obj, flags); |
| 52 | } |
| 53 | |
| 54 | int cmd_verify_commit(int argc, |
| 55 | const char **argv, |
no test coverage detected