This function tries to read the object name from the current index */
| 4192 | |
| 4193 | /* This function tries to read the object name from the current index */ |
| 4194 | static int get_current_oid(struct apply_state *state, const char *path, |
| 4195 | struct object_id *oid) |
| 4196 | { |
| 4197 | int pos; |
| 4198 | |
| 4199 | if (read_apply_cache(state) < 0) |
| 4200 | return -1; |
| 4201 | pos = index_name_pos(state->repo->index, path, strlen(path)); |
| 4202 | if (pos < 0) |
| 4203 | return -1; |
| 4204 | oidcpy(oid, &state->repo->index->cache[pos]->oid); |
| 4205 | return 0; |
| 4206 | } |
| 4207 | |
| 4208 | static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid) |
| 4209 | { |
no test coverage detected