summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-03-12 01:26:09 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2015-03-17 20:51:14 +0100
commita61fa4c0c70fe2c203bf73d163f9003763520f31 (patch)
tree3d4dd5ab2e50dafb3589437f447146fc96518f08 /include
parentd23fb5c943c3f4accd8b5176db1b78d377bfec54 (diff)
downloadlibgit2-a61fa4c0c70fe2c203bf73d163f9003763520f31.tar.gz
packbuilder: introduce git_packbuilder_insert_recur()
This function recursively inserts the given object and any referenced ones. It can be thought of as a more general version of the functions to insert a commit or tree.
Diffstat (limited to 'include')
-rw-r--r--include/git2/pack.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/pack.h b/include/git2/pack.h
index 4cf426273..4941998eb 100644
--- a/include/git2/pack.h
+++ b/include/git2/pack.h
@@ -128,6 +128,18 @@ GIT_EXTERN(int) git_packbuilder_insert_commit(git_packbuilder *pb, const git_oid
GIT_EXTERN(int) git_packbuilder_insert_walk(git_packbuilder *pb, git_revwalk *walk);
/**
+ * Recursively insert an object and its referenced objects
+ *
+ * Insert the object as well as any object it references.
+ *
+ * @param pb the packbuilder
+ * @param id the id of the root object to insert
+ * @param name optional name for the object
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_packbuilder_insert_recur(git_packbuilder *pb, const git_oid *id, const char *name);
+
+/**
* Write the contents of the packfile to an in-memory buffer
*
* The contents of the buffer will become a valid packfile, even though there