diff --git a/cache-tree.c b/cache-tree.c
index d8438d67d7ce5549c0b2baa377bec31202619138..35740b3647018b0dae7d38cab730b7d4d7213753 100644 (file)
--- a/cache-tree.c
+++ b/cache-tree.c
return down;
}
return down;
}
+struct cache_tree_sub *cache_tree_sub(struct cache_tree *it, const char *path)
+{
+ int pathlen = strlen(path);
+ return find_subtree(it, path, pathlen, 1);
+}
+
void cache_tree_invalidate_path(struct cache_tree *it, const char *path)
{
/* a/b/c
void cache_tree_invalidate_path(struct cache_tree *it, const char *path)
{
/* a/b/c
@@ -476,12 +482,11 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
struct cache_tree *sub;
struct cache_tree_sub *subtree;
const char *name = buf;
struct cache_tree *sub;
struct cache_tree_sub *subtree;
const char *name = buf;
- int namelen;
+
sub = read_one(&buf, &size);
if (!sub)
goto free_return;
sub = read_one(&buf, &size);
if (!sub)
goto free_return;
- namelen = strlen(name);
- subtree = find_subtree(it, name, namelen, 1);
+ subtree = cache_tree_sub(it, name);
subtree->cache_tree = sub;
}
if (subtree_nr != it->subtree_nr)
subtree->cache_tree = sub;
}
if (subtree_nr != it->subtree_nr)