| 2642 | } |
| 2643 | |
| 2644 | static int merged_sparse_dir(const struct cache_entry * const *src, int n, |
| 2645 | struct unpack_trees_options *o) |
| 2646 | { |
| 2647 | struct tree_desc t[MAX_UNPACK_TREES + 1]; |
| 2648 | void * tree_bufs[MAX_UNPACK_TREES + 1]; |
| 2649 | struct traverse_info info; |
| 2650 | int i, ret; |
| 2651 | |
| 2652 | /* |
| 2653 | * Create the tree traversal information for traversing into *only* the |
| 2654 | * sparse directory. |
| 2655 | */ |
| 2656 | setup_traverse_info(&info, src[0]->name); |
| 2657 | info.fn = unpack_sparse_callback; |
| 2658 | info.data = o; |
| 2659 | info.show_all_errors = o->internal.show_all_errors; |
| 2660 | info.pathspec = o->pathspec; |
| 2661 | |
| 2662 | /* Get the tree descriptors of the sparse directory in each of the merging trees */ |
| 2663 | for (i = 0; i < n; i++) |
| 2664 | tree_bufs[i] = fill_tree_descriptor(o->src_index->repo, &t[i], |
| 2665 | src[i] && !is_null_oid(&src[i]->oid) ? &src[i]->oid : NULL); |
| 2666 | |
| 2667 | ret = traverse_trees(o->src_index, n, t, &info); |
| 2668 | |
| 2669 | for (i = 0; i < n; i++) |
| 2670 | free(tree_bufs[i]); |
| 2671 | |
| 2672 | return ret; |
| 2673 | } |
| 2674 | |
| 2675 | static int deleted_entry(const struct cache_entry *ce, |
| 2676 | const struct cache_entry *old, |
no test coverage detected