MCPcopy Index your code
hub / github.com/git/git / get_current_oid

Function get_current_oid

apply.c:4194–4206  ·  view source on GitHub ↗

This function tries to read the object name from the current index */

Source from the content-addressed store, hash-verified

4192
4193/* This function tries to read the object name from the current index */
4194static 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
4208static int preimage_oid_in_gitlink_patch(struct patch *p, struct object_id *oid)
4209{

Callers 1

build_fake_ancestorFunction · 0.85

Calls 3

read_apply_cacheFunction · 0.85
index_name_posFunction · 0.85
oidcpyFunction · 0.85

Tested by

no test coverage detected