| 105 | } |
| 106 | |
| 107 | int parse_opt_commit(const struct option *opt, const char *arg, int unset) |
| 108 | { |
| 109 | struct object_id oid; |
| 110 | struct commit *commit; |
| 111 | struct commit **target = opt->value; |
| 112 | |
| 113 | BUG_ON_OPT_NEG(unset); |
| 114 | |
| 115 | if (!arg) |
| 116 | return -1; |
| 117 | if (repo_get_oid(the_repository, arg, &oid)) |
| 118 | return error("malformed object name %s", arg); |
| 119 | commit = lookup_commit_reference(the_repository, &oid); |
| 120 | if (!commit) |
| 121 | return error("no such commit %s", arg); |
| 122 | *target = commit; |
| 123 | return 0; |
| 124 | } |
| 125 | |
| 126 | int parse_opt_object_name(const struct option *opt, const char *arg, int unset) |
| 127 | { |
nothing calls this directly
no test coverage detected