summaryrefslogtreecommitdiff
path: root/include/git2/pack.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2013-11-06 18:41:08 -0500
committerEdward Thomson <ethomson@microsoft.com>2013-11-07 09:43:24 -0500
commitcc2447da32a20f5d089125839555ed0fe2a05592 (patch)
treef4907d35364e168b3c32ecfcb352ea5b530c05d2 /include/git2/pack.h
parente87d9d3d4d8de9c048476387931c4ac57d1c2b73 (diff)
downloadlibgit2-cc2447da32a20f5d089125839555ed0fe2a05592.tar.gz
Add git_packbuilder_hash to query pack filename
Diffstat (limited to 'include/git2/pack.h')
-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