summaryrefslogtreecommitdiff
path: root/src/tree-cache.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-07-10 14:10:39 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-10-10 19:35:19 +0200
commit6843cebe17b7ce15eb9a6d1a88ac2e7e9c00d5b9 (patch)
tree70d5887084b1ba6e471f9f5723414cd7748575e9 /src/tree-cache.h
parent19c88310cb79153e19b93c59020b2f7c34794f6e (diff)
downloadlibgit2-6843cebe17b7ce15eb9a6d1a88ac2e7e9c00d5b9.tar.gz
index: fill the tree cache when reading from a tree
When reading from a tree, we know what every tree is going to look like, so we can fill in the tree cache completely, making use of the index for modification of trees a lot quicker.
Diffstat (limited to 'src/tree-cache.h')
-rw-r--r--src/tree-cache.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tree-cache.h b/src/tree-cache.h
index d41a51f84..d75049d8b 100644
--- a/src/tree-cache.h
+++ b/src/tree-cache.h
@@ -27,6 +27,10 @@ int git_tree_cache_read(git_tree_cache **tree, const char *buffer, size_t buffer
void git_tree_cache_invalidate_path(git_tree_cache *tree, const char *path);
const git_tree_cache *git_tree_cache_get(const git_tree_cache *tree, const char *path);
int git_tree_cache_new(git_tree_cache **out, const char *name, git_tree_cache *parent, git_pool *pool);
+/**
+ * Read a tree as the root of the tree cache (like for `git read-tree`)
+ */
+int git_tree_cache_read_tree(git_tree_cache **out, const git_tree *tree, git_pool *pool);
void git_tree_cache_free(git_tree_cache *tree);
#endif