summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-11-07 08:52:32 -0800
committerVicent Martí <vicent@github.com>2013-11-07 08:52:32 -0800
commit9018a453ea801a965795af6c8f8523a49f4d167b (patch)
treef4907d35364e168b3c32ecfcb352ea5b530c05d2 /include/git2
parente87d9d3d4d8de9c048476387931c4ac57d1c2b73 (diff)
parentcc2447da32a20f5d089125839555ed0fe2a05592 (diff)
downloadlibgit2-9018a453ea801a965795af6c8f8523a49f4d167b.tar.gz
Merge pull request #1949 from ethomson/packbuilder_oid
Add git_packbuilder_hash to query pack filename
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/pack.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/pack.h b/include/git2/pack.h
index 748817666..4632699d1 100644
--- a/include/git2/pack.h
+++ b/include/git2/pack.h
@@ -130,6 +130,16 @@ GIT_EXTERN(int) git_packbuilder_write(
git_transfer_progress_callback progress_cb,
void *progress_cb_payload);
+/**
+* Get the packfile's hash
+*
+* A packfile's name is derived from the sorted hashing of all object
+* names. This is only correct after the packfile has been written.
+*
+* @param pb The packbuilder object
+*/
+GIT_EXTERN(const git_oid *) git_packbuilder_hash(git_packbuilder *pb);
+
typedef int (*git_packbuilder_foreach_cb)(void *buf, size_t size, void *payload);
/**
* Create the new pack and pass each object to the callback