diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-02-21 10:13:29 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-02-22 11:25:14 +0000 |
| commit | 975d6722a5c203427ab63789d329c00b76461225 (patch) | |
| tree | 140a2845b3092645930d87e43731cca8d9277cb5 /include/git2/indexer.h | |
| parent | 4069f924855d596871a7e1f16c5c3f67a16dd5f4 (diff) | |
| download | libgit2-975d6722a5c203427ab63789d329c00b76461225.tar.gz | |
indexer: rename git_transfer_progress
The name `git_transfer_progress` does not reflect its true purpose.
It suggests that it's progress for a non-existence `git_transfer`
object, and is used for indexing callbacks more broadly than just
during transfers.
Rename `git_transfer_progress` to `git_indexer_progress`.
Diffstat (limited to 'include/git2/indexer.h')
| -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 94d8785c0..a65d9d710 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -15,6 +15,51 @@ GIT_BEGIN_DECL typedef struct git_indexer git_indexer; +/** + * This structure is used to provide callers information about the + * progress of indexing a packfile, either directly or part of a + * fetch or clone that downloads a packfile. + */ +typedef struct git_indexer_progress { + /** number of objects in the packfile being indexed */ + unsigned int total_objects; + + /** received objects that have been hashed */ + unsigned int indexed_objects; + + /** received_objects: objects which have been downloaded */ + unsigned int received_objects; + + /** + * locally-available objects that have been injected in order + * to fix a thin pack + */ + unsigned int local_objects; + + /** number of deltas in the packfile being indexed */ + unsigned int total_deltas; + + /** received deltas that have been indexed */ + unsigned int indexed_deltas; + + /** size of the packfile received up to now */ + size_t received_bytes; +} git_indexer_progress; + +typedef git_indexer_progress git_transfer_progress; + +/** + * Type for progress callbacks during indexing. Return a value less + * than zero to cancel the indexing or download. + * + * @param stats Structure containing information about the state of the tran sfer + * @param payload Payload provided by caller + */ +typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload); + +typedef git_indexer_progress_cb git_transfer_progress_cb; + + typedef struct git_indexer_options { unsigned int version; |
