| 673 | } |
| 674 | |
| 675 | static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *path) |
| 676 | { |
| 677 | if (!it) |
| 678 | return NULL; |
| 679 | while (*path) { |
| 680 | const char *slash; |
| 681 | struct cache_tree_sub *sub; |
| 682 | |
| 683 | slash = strchrnul(path, '/'); |
| 684 | /* |
| 685 | * Between path and slash is the name of the subtree |
| 686 | * to look for. |
| 687 | */ |
| 688 | sub = find_subtree(it, path, slash - path, 0); |
| 689 | if (!sub) |
| 690 | return NULL; |
| 691 | it = sub->cache_tree; |
| 692 | |
| 693 | path = slash; |
| 694 | while (*path == '/') |
| 695 | path++; |
| 696 | } |
| 697 | return it; |
| 698 | } |
| 699 | |
| 700 | static int write_index_as_tree_internal(struct object_id *oid, |
| 701 | struct index_state *index_state, |
no test coverage detected