| 1110 | } |
| 1111 | |
| 1112 | static int try_explicit_object_name(const char *name, |
| 1113 | struct ref **match) |
| 1114 | { |
| 1115 | struct object_id oid; |
| 1116 | |
| 1117 | if (!*name) { |
| 1118 | if (match) |
| 1119 | *match = alloc_delete_ref(); |
| 1120 | return 0; |
| 1121 | } |
| 1122 | |
| 1123 | if (repo_get_oid(the_repository, name, &oid)) |
| 1124 | return -1; |
| 1125 | |
| 1126 | if (match) { |
| 1127 | *match = alloc_ref(name); |
| 1128 | oidcpy(&(*match)->new_oid, &oid); |
| 1129 | } |
| 1130 | return 0; |
| 1131 | } |
| 1132 | |
| 1133 | static struct ref *make_linked_ref(const char *name, struct ref ***tail) |
| 1134 | { |
no test coverage detected