Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-11-05 18:54:34 +0400
committerVicent Martí <vicent@github.com>2012-11-05 18:54:34 +0400
commit942a76983bb3d2d1d6c8df434c1fe55f4763ca5d (patch)
treeb428c0a332d0551089e78c37fa23cd60e1115e22 /src/pack-objects.c
parent1e99ce9ac7d7a73f629327d020034e4b2ed1374c (diff)
parentb4b935d8abd52e00f08518f39b6c59aab73926ce (diff)
Merge pull request #1034 from carlosmn/packbuilder-foreach
Let the user grab the packfile as it's being written
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r--src/pack-objects.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c
index b39684865..7acc93328 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -1237,6 +1237,12 @@ int git_packbuilder_send(git_packbuilder *pb, gitno_socket *s)
return write_pack(pb, &send_pack_file, s);
}
+int git_packbuilder_foreach(git_packbuilder *pb, int (*cb)(void *buf, size_t size, void *payload), void *payload)
+{
+ PREPARE_PACK;
+ return write_pack(pb, cb, payload);
+}
+
int git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb)
{
PREPARE_PACK;
@@ -1286,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)