diff options
author | Ben Straub <bs@github.com> | 2013-10-03 06:20:20 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-10-03 06:20:20 -0700 |
commit | fc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc (patch) | |
tree | 1446cb018eb05571b4eff101ceae937688e83a1d /include/git2/pack.h | |
parent | de8fe729efd350ae5cb1ef25ffb08f92c6f706b9 (diff) | |
parent | ab1368766240cfe861729642abe1cddd01c0203e (diff) | |
download | libgit2-fc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc.tar.gz |
Merge branch 'development' into blame
Conflicts:
include/git2.h
Diffstat (limited to 'include/git2/pack.h')
-rw-r--r-- | include/git2/pack.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/git2/pack.h b/include/git2/pack.h index 976e39cb4..7ebdd5cf3 100644 --- a/include/git2/pack.h +++ b/include/git2/pack.h @@ -46,6 +46,14 @@ GIT_BEGIN_DECL /** + * Stages that are reported by the packbuilder progress callback. + */ +typedef enum { + GIT_PACKBUILDER_ADDING_OBJECTS = 0, + GIT_PACKBUILDER_DELTAFICATION = 1, +} git_packbuilder_stage_t; + +/** * Initialize a new packbuilder * * @param out The new packbuilder object @@ -149,6 +157,28 @@ GIT_EXTERN(uint32_t) git_packbuilder_object_count(git_packbuilder *pb); */ GIT_EXTERN(uint32_t) git_packbuilder_written(git_packbuilder *pb); +/** Packbuilder progress notification function */ +typedef void (*git_packbuilder_progress)( + int stage, + unsigned int current, + unsigned int total, + void *payload); + +/** + * Set the callbacks for a packbuilder + * + * @param pb The packbuilder object + * @param progress_cb Function to call with progress information during + * pack building. Be aware that this is called inline with pack building + * operations, so performance may be affected. + * @param progress_cb_payload Payload for progress callback. + * @return 0 or an error code + */ +GIT_EXTERN(int) git_packbuilder_set_callbacks( + git_packbuilder *pb, + git_packbuilder_progress progress_cb, + void *progress_cb_payload); + /** * Free the packbuilder and all associated data * |