mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-03 22:01:26 +00:00
packbuilder: add accessors for the number of total and written objects
This commit is contained in:
parent
3dfed9cb86
commit
b4b935d8ab
@ -87,6 +87,20 @@ GIT_EXTERN(int) git_packbuilder_write(git_packbuilder *pb, const char *file);
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@ -1292,6 +1292,16 @@ int git_packbuilder_insert_tree(git_packbuilder *pb, const git_oid *oid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t git_packbuilder_object_count(git_packbuilder *pb)
|
||||
{
|
||||
return pb->nr_objects;
|
||||
}
|
||||
|
||||
uint32_t git_packbuilder_written(git_packbuilder *pb)
|
||||
{
|
||||
return pb->nr_written;
|
||||
}
|
||||
|
||||
void git_packbuilder_free(git_packbuilder *pb)
|
||||
{
|
||||
if (pb == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user