| 545 | #define FANOUT_PATH_MAX GIT_MAX_HEXSZ + FANOUT_PATH_SEPARATORS_MAX + 1 |
| 546 | |
| 547 | static 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 | |
| 562 | static int for_each_note_helper(struct notes_tree *t, struct int_node *tree, |
| 563 | unsigned char n, unsigned char fanout, int flags, |
no test coverage detected