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

Function get_oid_hex_from_objpath

http-push.c:1025–1039  ·  view source on GitHub ↗

extract hex from sharded "xx/x{38}" filename */

Source from the content-addressed store, hash-verified

1023
1024/* extract hex from sharded "xx/x{38}" filename */
1025static int get_oid_hex_from_objpath(const char *path, struct object_id *oid)
1026{
1027 memset(oid->hash, 0, GIT_MAX_RAWSZ);
1028 oid->algo = hash_algo_by_ptr(the_hash_algo);
1029
1030 if (strlen(path) != the_hash_algo->hexsz + 1)
1031 return -1;
1032
1033 if (hex_to_bytes(oid->hash, path, 1))
1034 return -1;
1035 path += 2;
1036 path++; /* skip '/' */
1037
1038 return hex_to_bytes(oid->hash + 1, path, the_hash_algo->rawsz - 1);
1039}
1040
1041static void process_ls_object(struct remote_ls_ctx *ls)
1042{

Callers 1

process_ls_objectFunction · 0.85

Calls 2

hash_algo_by_ptrFunction · 0.85
hex_to_bytesFunction · 0.85

Tested by

no test coverage detected