summaryrefslogtreecommitdiff
path: root/include/git2/odb.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2012-11-05 11:33:10 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2012-11-05 16:00:29 -0600
commit09cc0b92dc60c726180cda36643e263c32d9a812 (patch)
tree8b07bb41b327e75c6c92616ec891809b11552ed7 /include/git2/odb.h
parenta5e85d86b7e13352c553b0a43bc36fee5880b5c7 (diff)
downloadlibgit2-09cc0b92dc60c726180cda36643e263c32d9a812.tar.gz
create callback to handle packs from fetch, move the indexer to odb_pack
Diffstat (limited to 'include/git2/odb.h')
-rw-r--r--include/git2/odb.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h
index c6e73571b..4afa3b788 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -11,6 +11,7 @@
#include "types.h"
#include "oid.h"
#include "odb_backend.h"
+#include "indexer.h"
/**
* @file git2/odb.h
@@ -263,6 +264,26 @@ GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **stream, git_odb *db, size_
GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oid);
/**
+ * Open a stream for writing a pack file to the ODB.
+ *
+ * If the ODB layer understands pack files, then the given
+ * packfile will likely be streamed directly to disk (and a
+ * corresponding index created). If the ODB layer does not
+ * understand pack files, the objects will be stored in whatever
+ * format the ODB layer uses.
+ *
+ * @see git_odb_writepack
+ *
+ * @param writepack pointer to the writepack functions
+ * @param db object database where the stream will read from
+ * @param progress_cb function to call with progress information.
+ * Be aware that this is called inline with network and indexing operations,
+ * so performance may be affected.
+ * @param progress_payload payload for the progress callback
+ */
+GIT_EXTERN(int) git_odb_write_pack(git_odb_writepack **writepack, git_odb *db, git_transfer_progress_callback progress_cb, void *progress_payload);
+
+/**
* Determine the object-ID (sha1 hash) of a data buffer
*
* The resulting SHA-1 OID will be the identifier for the data