extract hex from sharded "xx/x{38}" filename */
| 1023 | |
| 1024 | /* extract hex from sharded "xx/x{38}" filename */ |
| 1025 | static 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 | |
| 1041 | static void process_ls_object(struct remote_ls_ctx *ls) |
| 1042 | { |
no test coverage detected