cache-tree: remove cache_tree_find_path()

This reverts 080ab56a46 (cache-tree: implement cache_tree_find_path(), 2022-05-23). The cache_tree_find_path() method was never actually called in the topic that added it. I cannot find any reference to it in any of my forks, so this appears to not be needed at the moment. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Derrick Stolee committed Jun 16, 2022 at 13:13 UTC 86aa250aa871a4d8314f1f51ee007e93a9461e1e
2 files changed -29
cache-tree.c
-27
@@ -101,33 +101,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *it, const char *path)
101 return find_subtree(it, path, pathlen, 1);
102 }
103
104 -struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path)
105 -{
106 - const char *slash;
107 - int namelen;
108 - struct cache_tree_sub it_sub = {
109 - .cache_tree = it,
110 - };
111 - struct cache_tree_sub *down = &it_sub;
112 -
113 - while (down) {
114 - slash = strchrnul(path, '/');
115 - namelen = slash - path;
116 - down->cache_tree->entry_count = -1;
117 - if (!*slash) {
118 - int pos;
119 - pos = cache_tree_subtree_pos(down->cache_tree, path, namelen);
120 - if (0 <= pos)
121 - return down->cache_tree->down[pos]->cache_tree;
122 - return NULL;
123 - }
124 - down = find_subtree(it, path, namelen, 0);
125 - path = slash + 1;
126 - }
127 -
128 - return NULL;
129 -}
130 -
104 static int do_invalidate_path(struct cache_tree *it, const char *path)
105 {
106 /* a/b/c
cache-tree.h
-2
@@ -29,8 +29,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
29
30 int cache_tree_subtree_pos(struct cache_tree *it, const char *path, int pathlen);
31
32 -struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path);
33 -
32 void cache_tree_write(struct strbuf *, struct cache_tree *root);
33 struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
34