diff options
Diffstat (limited to 'cache-tree.c')
-rw-r--r-- | cache-tree.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/cache-tree.c b/cache-tree.c index ff794d940f..c97111cccf 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -101,33 +101,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *it, const char *path) return find_subtree(it, path, pathlen, 1); } -struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path) -{ - const char *slash; - int namelen; - struct cache_tree_sub it_sub = { - .cache_tree = it, - }; - struct cache_tree_sub *down = &it_sub; - - while (down) { - slash = strchrnul(path, '/'); - namelen = slash - path; - down->cache_tree->entry_count = -1; - if (!*slash) { - int pos; - pos = cache_tree_subtree_pos(down->cache_tree, path, namelen); - if (0 <= pos) - return down->cache_tree->down[pos]->cache_tree; - return NULL; - } - down = find_subtree(it, path, namelen, 0); - path = slash + 1; - } - - return NULL; -} - static int do_invalidate_path(struct cache_tree *it, const char *path) { /* a/b/c @@ -884,9 +857,7 @@ int cache_tree_matches_traversal(struct cache_tree *root, return 0; } -static void verify_one_sparse(struct repository *r, - struct index_state *istate, - struct cache_tree *it, +static void verify_one_sparse(struct index_state *istate, struct strbuf *path, int pos) { @@ -937,7 +908,7 @@ static int verify_one(struct repository *r, return 1; if (pos >= 0) { - verify_one_sparse(r, istate, it, path, pos); + verify_one_sparse(istate, path, pos); return 0; } |