diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/odb.h | 14 | ||||
| -rw-r--r-- | include/git2/sys/odb_backend.h | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h index 702e1bd30..dd484553f 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -391,6 +391,20 @@ GIT_EXTERN(int) git_odb_write_pack( void *progress_payload); /** + * Write a `multi-pack-index` file from all the `.pack` files in the ODB. + * + * If the ODB layer understands pack files, then this will create a file called + * `multi-pack-index` next to the `.pack` and `.idx` files, which will contain + * an index of all objects stored in `.pack` files. This will allow for + * O(log n) lookup for n objects (regardless of how many packfiles there + * exist). + * + * @param db object database where the `multi-pack-index` file will be written. + */ +GIT_EXTERN(int) git_odb_write_multi_pack_index( + git_odb *db); + +/** * Determine the object-ID (sha1 hash) of a data buffer * * The resulting SHA-1 OID will be the identifier for the data diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h index 4dba460af..9ae0ed9b3 100644 --- a/include/git2/sys/odb_backend.h +++ b/include/git2/sys/odb_backend.h @@ -85,6 +85,13 @@ struct git_odb_backend { git_indexer_progress_cb progress_cb, void *progress_payload); /** + * If the backend supports pack files, this will create a + * `multi-pack-index` file which will contain an index of all objects + * across all the `.pack` files. + */ + int GIT_CALLBACK(writemidx)(git_odb_backend *); + + /** * "Freshens" an already existing object, updating its last-used * time. This occurs when `git_odb_write` was called, but the * object already existed (and will not be re-written). The |
