diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2012-10-31 10:26:04 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2012-11-01 06:21:49 +0100 |
commit | 3dfed9cb86a54bc8266057ef62b99f5d889f4efc (patch) | |
tree | b3fbe62f550fb1224404fe18bd5524f20eb7760d /include/git2/pack.h | |
parent | efde422553e1181933d0bc9d7112740e858a847b (diff) | |
download | libgit2-3dfed9cb86a54bc8266057ef62b99f5d889f4efc.tar.gz |
packbuilder: add git_packbuilder_foreach
Let the user get each object as a buffer+size pair so they can handle
the packfile content as they need to.
Diffstat (limited to 'include/git2/pack.h')
-rw-r--r-- | include/git2/pack.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/pack.h b/include/git2/pack.h index 748ad2e11..7e28a67e8 100644 --- a/include/git2/pack.h +++ b/include/git2/pack.h @@ -78,6 +78,16 @@ GIT_EXTERN(int) git_packbuilder_insert_tree(git_packbuilder *pb, const git_oid * GIT_EXTERN(int) git_packbuilder_write(git_packbuilder *pb, const char *file); /** + * Create the new pack and pass each object to the callback + * + * @param pb the packbuilder + * @param cb the callback to call with each packed object's buffer + * @param data the callback's data + * @return 0 or an error code + */ +GIT_EXTERN(int) git_packbuilder_foreach(git_packbuilder *pb, int (*cb)(void *buf, size_t size, void *data), void *data); + +/** * Free the packbuilder and all associated data * * @param pb The packbuilder |