From 3dfed9cb86a54bc8266057ef62b99f5d889f4efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 31 Oct 2012 10:26:04 +0100 Subject: 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. --- include/git2/pack.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/git2/pack.h') 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 @@ -77,6 +77,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 * -- cgit v1.2.1