diff options
| author | Vicent Martà <tanoku@gmail.com> | 2012-04-19 11:40:56 -0700 |
|---|---|---|
| committer | Vicent Martà <tanoku@gmail.com> | 2012-04-19 11:40:56 -0700 |
| commit | d59305544e4825a7668d6d2fa9df2a0ffa21a3d6 (patch) | |
| tree | 4ffce3f8c3e384ad8b1a242caed33e601626a123 /include | |
| parent | 54e4d0f25b4a957fba23dee4119dff9427151b90 (diff) | |
| parent | 1c9c081a6a0e02ea8a148717083e3f7a769c5a2e (diff) | |
| download | libgit2-d59305544e4825a7668d6d2fa9df2a0ffa21a3d6.tar.gz | |
Merge remote-tracking branch 'carlosmn/indexer-stream' into new-error-handling
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/indexer.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/include/git2/indexer.h b/include/git2/indexer.h index 7f336f8e6..a70fab214 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -23,6 +23,51 @@ typedef struct git_indexer_stats { typedef struct git_indexer git_indexer; +typedef struct git_indexer_stream git_indexer_stream; + +/** + * Create a new streaming indexer instance + * + * @param out where to store the inexer instance + * @param path to the gitdir (metadata directory) + */ +GIT_EXTERN(int) git_indexer_stream_new(git_indexer_stream **out, const char *gitdir); + +/** + * Add data to the indexer + * + * @param idx the indexer + * @param data the data to add + * @param size the size of the data + * @param stats stat storage + */ +GIT_EXTERN(int) git_indexer_stream_add(git_indexer_stream *idx, void *data, size_t size, git_indexer_stats *stats); + +/** + * Finalize the pack and index + * + * Resolve any pending deltas and write out the index file + * + * @param idx the indexer + */ +GIT_EXTERN(int) git_indexer_stream_finalize(git_indexer_stream *idx, git_indexer_stats *stats); + +/** + * 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 index has been finalized. + * + * @param idx the indexer instance + */ +GIT_EXTERN(const git_oid *) git_indexer_stream_hash(git_indexer_stream *idx); + +/** + * Free the indexer and its resources + * + * @param idx the indexer to free + */ +GIT_EXTERN(void) git_indexer_stream_free(git_indexer_stream *idx); /** * Create a new indexer instance |
