diff options
| author | Vicent Martà <vicent@github.com> | 2012-11-05 06:54:34 -0800 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-11-05 06:54:34 -0800 |
| commit | 942a76983bb3d2d1d6c8df434c1fe55f4763ca5d (patch) | |
| tree | b428c0a332d0551089e78c37fa23cd60e1115e22 /include/git2 | |
| parent | 1e99ce9ac7d7a73f629327d020034e4b2ed1374c (diff) | |
| parent | b4b935d8abd52e00f08518f39b6c59aab73926ce (diff) | |
| download | libgit2-942a76983bb3d2d1d6c8df434c1fe55f4763ca5d.tar.gz | |
Merge pull request #1034 from carlosmn/packbuilder-foreach
Let the user grab the packfile as it's being written
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/pack.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/pack.h b/include/git2/pack.h index 748ad2e11..94d5fc6a1 100644 --- a/include/git2/pack.h +++ b/include/git2/pack.h @@ -78,6 +78,30 @@ 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); + +/** + * Get the total number of objects the packbuilder will write out + * + * @param pb the packbuilder + */ +GIT_EXTERN(uint32_t) git_packbuilder_object_count(git_packbuilder *pb); + +/** + * Get the number of objects the packbuilder has already written out + * + * @param pb the packbuilder + */ +GIT_EXTERN(uint32_t) git_packbuilder_written(git_packbuilder *pb); + +/** * Free the packbuilder and all associated data * * @param pb The packbuilder |
