summaryrefslogtreecommitdiff
path: root/include/git2/tree.h
diff options
context:
space:
mode:
authorSarath Lakshman <sarathlakshman@slynux.com>2011-04-03 17:18:56 +0530
committerSarath Lakshman <sarathlakshman@slynux.com>2011-04-03 17:18:56 +0530
commit47d8ec56e917adda2e336c29420f527fca733866 (patch)
tree04b44dfbcad8ee5de02bfa6704e9e7d3a703c08d /include/git2/tree.h
parent3e3e4631a0362ba2358c9a2227e3cf0aaec8cf53 (diff)
downloadlibgit2-47d8ec56e917adda2e336c29420f527fca733866.tar.gz
New external API method: `git_tree_create`
Creates a tree by scanning the index file. The method handles recursive creation of trees for subdirectories and adds them to the parent tree.
Diffstat (limited to 'include/git2/tree.h')
-rw-r--r--include/git2/tree.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/tree.h b/include/git2/tree.h
index 164aec9e2..bd1f97073 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -138,6 +138,18 @@ GIT_EXTERN(const git_oid *) git_tree_entry_id(git_tree_entry *entry);
*/
GIT_EXTERN(int) git_tree_entry_2object(git_object **object_out, git_repository *repo, git_tree_entry *entry);
+/**
+ * Create tree by scanning the index file.
+ *
+ * @param object identity for the tree
+ * @param repository where to lookup for object db
+ * @param base directory path
+ * @param path length for base
+ * @param index entry offset to start scan
+ * @return number of items added to the tree
+ */
+GIT_EXTERN(int) git_tree_create(git_oid *oid, git_repository *repo, const char *base, int baselen, int entry_no);
+
/** @} */
GIT_END_DECL
#endif