diff options
author | Vicent Martà <vicent@github.com> | 2013-10-28 09:25:44 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2013-10-28 09:25:44 -0700 |
commit | 5c50f22a93c78190fb7d81802199ff9defc8cf55 (patch) | |
tree | 66e9f28cb6a3c7cc2f4f4931173410cd4f80b32a /include/git2 | |
parent | 064e6e8121a6265b42f41f1b12468573cb3ccb19 (diff) | |
parent | ab46b1d8ebcdc820aefe2c1391d4be73939bce95 (diff) | |
download | libgit2-5c50f22a93c78190fb7d81802199ff9defc8cf55.tar.gz |
Merge pull request #1891 from libgit2/cmn/fix-thin-packs
Add support for thin packs
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/indexer.h | 4 | ||||
-rw-r--r-- | include/git2/sys/odb_backend.h | 2 | ||||
-rw-r--r-- | include/git2/types.h | 10 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/git2/indexer.h b/include/git2/indexer.h index 4db072c9b..0858b6ea1 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -20,12 +20,16 @@ typedef struct git_indexer_stream git_indexer_stream; * * @param out where to store the indexer instance * @param path to the directory where the packfile should be stored + * @param odb object database from which to read base objects when + * fixing thin packs. Pass NULL if no thin pack is expected (an error + * will be returned if there are bases missing) * @param progress_cb function to call with progress information * @param progress_cb_payload payload for the progress callback */ GIT_EXTERN(int) git_indexer_stream_new( git_indexer_stream **out, const char *path, + git_odb *odb, git_transfer_progress_callback progress_cb, void *progress_cb_payload); diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h index 4365906d4..8039a5b82 100644 --- a/include/git2/sys/odb_backend.h +++ b/include/git2/sys/odb_backend.h @@ -80,7 +80,7 @@ struct git_odb_backend { git_odb_backend *, git_odb_foreach_cb cb, void *payload); int (* writepack)( - git_odb_writepack **, git_odb_backend *, + git_odb_writepack **, git_odb_backend *, git_odb *odb, git_transfer_progress_callback progress_cb, void *progress_payload); void (* free)(git_odb_backend *); diff --git a/include/git2/types.h b/include/git2/types.h index b500c986d..2d18d385a 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -212,11 +212,21 @@ typedef struct git_remote_callbacks git_remote_callbacks; /** * This is passed as the first argument to the callback to allow the * user to see the progress. + * + * - total_objects: number of objects in the packfile being downloaded + * - indexed_objects: received objects that have been hashed + * - received_objects: objects which have been downloaded + * - local_objects: locally-available objects that have been injected + * in order to fix a thin pack. + * - received-bytes: size of the packfile received up to now */ typedef struct git_transfer_progress { unsigned int total_objects; unsigned int indexed_objects; unsigned int received_objects; + unsigned int local_objects; + unsigned int total_deltas; + unsigned int indexed_deltas; size_t received_bytes; } git_transfer_progress; |