Skip to content

Commit 86aa250

Browse files
derrickstoleegitster
authored andcommitted
cache-tree: remove cache_tree_find_path()
This reverts 080ab56 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 82db195 commit 86aa250

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

cache-tree.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -101,33 +101,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *it, const char *path)
101101
return find_subtree(it, path, pathlen, 1);
102102
}
103103

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-
131104
static int do_invalidate_path(struct cache_tree *it, const char *path)
132105
{
133106
/* a/b/c

cache-tree.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ struct cache_tree_sub *cache_tree_sub(struct cache_tree *, const char *);
2929

3030
int cache_tree_subtree_pos(struct cache_tree *it, const char *path, int pathlen);
3131

32-
struct cache_tree *cache_tree_find_path(struct cache_tree *it, const char *path);
33-
3432
void cache_tree_write(struct strbuf *, struct cache_tree *root);
3533
struct cache_tree *cache_tree_read(const char *buffer, unsigned long size);
3634

0 commit comments

Comments
 (0)