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

Function construct_path_with_fanout

notes.c:547–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545#define FANOUT_PATH_MAX GIT_MAX_HEXSZ + FANOUT_PATH_SEPARATORS_MAX + 1
546
547static void construct_path_with_fanout(const unsigned char *hash,
548 unsigned char fanout, char *path)
549{
550 unsigned int i = 0, j = 0;
551 const char *hex_hash = hash_to_hex(hash);
552 assert(fanout < the_hash_algo->rawsz);
553 while (fanout) {
554 path[i++] = hex_hash[j++];
555 path[i++] = hex_hash[j++];
556 path[i++] = '/';
557 fanout--;
558 }
559 xsnprintf(path + i, FANOUT_PATH_MAX - i, "%s", hex_hash + j);
560}
561
562static int for_each_note_helper(struct notes_tree *t, struct int_node *tree,
563 unsigned char n, unsigned char fanout, int flags,

Callers 1

for_each_note_helperFunction · 0.70

Calls 2

hash_to_hexFunction · 0.85
xsnprintfFunction · 0.85

Tested by

no test coverage detected