]> git.ipfire.org Git - thirdparty/git.git/blobdiff - cache-tree.c
commit-graph: avoid leaking topo_levels slab in write_commit_graph()
[thirdparty/git.git] / cache-tree.c
index acac6d58c37604fb52b1584f9e07f747561dae81..2fb483d3c0838998677d53327100db7bc134e2f3 100644 (file)
@@ -45,7 +45,7 @@ static int subtree_name_cmp(const char *one, int onelen,
        return memcmp(one, two, onelen);
 }
 
-static int subtree_pos(struct cache_tree *it, const char *path, int pathlen)
+int cache_tree_subtree_pos(struct cache_tree *it, const char *path, int pathlen)
 {
        struct cache_tree_sub **down = it->down;
        int lo, hi;
@@ -72,7 +72,7 @@ static struct cache_tree_sub *find_subtree(struct cache_tree *it,
                                           int create)
 {
        struct cache_tree_sub *down;
-       int pos = subtree_pos(it, path, pathlen);
+       int pos = cache_tree_subtree_pos(it, path, pathlen);
        if (0 <= pos)
                return it->down[pos];
        if (!create)
@@ -123,7 +123,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
        it->entry_count = -1;
        if (!*slash) {
                int pos;
-               pos = subtree_pos(it, path, namelen);
+               pos = cache_tree_subtree_pos(it, path, namelen);
                if (0 <= pos) {
                        cache_tree_free(&it->down[pos]->cache_tree);
                        free(it->down[pos]);