summaryrefslogtreecommitdiff
path: root/src/git/tree.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-09-20 21:39:11 +0300
committerVicent Marti <tanoku@gmail.com>2010-09-20 21:39:11 +0300
commitd45b4a9a1bcbb157a4f02cf5ed23fde5222db9c8 (patch)
tree554847491982e4256559938b1dab33730b2cffcb /src/git/tree.h
parent0c3596f18a6f07d8a61f8d6e2fd730a276a51599 (diff)
downloadlibgit2-d45b4a9a1bcbb157a4f02cf5ed23fde5222db9c8.tar.gz
Add support for in-memory objects
All repository objects can now be created from scratch in memory using either the git_object_new() method, or the corresponding git_XXX_new() for each object. So far, only git_commits can be written back to disk once created in memory. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/tree.h')
-rw-r--r--src/git/tree.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/git/tree.h b/src/git/tree.h
index 646c085bb..32fd6527a 100644
--- a/src/git/tree.h
+++ b/src/git/tree.h
@@ -32,6 +32,18 @@ typedef struct git_tree git_tree;
*/
GIT_EXTERN(git_tree *) git_tree_lookup(git_repository *repo, const git_oid *id);
+/*
+ * Create a new in-memory git_tree.
+ *
+ * The tree object must be manually filled using
+ * setter methods before it can be written to its
+ * repository.
+ *
+ * @param repo The repository where the object will reside
+ * @return the object if creation was posible; NULL otherwise
+ */
+GIT_EXTERN(git_tree *) git_tree_new(git_repository *repo);
+
/**
* Get the id of a tree.
* @param tree a previously loaded tree.