@@ -15,11 +15,52 @@ GIT_BEGIN_DECL
1515
1616typedef struct git_indexer git_indexer ;
1717
18+ /**
19+ * This structure is used to provide callers information about the
20+ * progress of indexing a packfile, either directly or part of a
21+ * fetch or clone that downloads a packfile.
22+ */
23+ typedef struct git_indexer_progress {
24+ /** number of objects in the packfile being indexed */
25+ unsigned int total_objects ;
26+
27+ /** received objects that have been hashed */
28+ unsigned int indexed_objects ;
29+
30+ /** received_objects: objects which have been downloaded */
31+ unsigned int received_objects ;
32+
33+ /**
34+ * locally-available objects that have been injected in order
35+ * to fix a thin pack
36+ */
37+ unsigned int local_objects ;
38+
39+ /** number of deltas in the packfile being indexed */
40+ unsigned int total_deltas ;
41+
42+ /** received deltas that have been indexed */
43+ unsigned int indexed_deltas ;
44+
45+ /** size of the packfile received up to now */
46+ size_t received_bytes ;
47+ } git_indexer_progress ;
48+
49+ /**
50+ * Type for progress callbacks during indexing. Return a value less
51+ * than zero to cancel the indexing or download.
52+ *
53+ * @param stats Structure containing information about the state of the tran sfer
54+ * @param payload Payload provided by caller
55+ */
56+ typedef int GIT_CALLBACK (git_indexer_progress_cb )(const git_indexer_progress * stats , void * payload );
57+
58+
1859typedef struct git_indexer_options {
1960 unsigned int version ;
2061
2162 /** progress_cb function to call with progress information */
22- git_transfer_progress_cb progress_cb ;
63+ git_indexer_progress_cb progress_cb ;
2364 /** progress_cb_payload payload for the progress callback */
2465 void * progress_cb_payload ;
2566
@@ -69,7 +110,7 @@ GIT_EXTERN(int) git_indexer_new(
69110 * @param size the size of the data in bytes
70111 * @param stats stat storage
71112 */
72- GIT_EXTERN (int ) git_indexer_append (git_indexer * idx , const void * data , size_t size , git_transfer_progress * stats );
113+ GIT_EXTERN (int ) git_indexer_append (git_indexer * idx , const void * data , size_t size , git_indexer_progress * stats );
73114
74115/**
75116 * Finalize the pack and index
@@ -78,7 +119,7 @@ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t si
78119 *
79120 * @param idx the indexer
80121 */
81- GIT_EXTERN (int ) git_indexer_commit (git_indexer * idx , git_transfer_progress * stats );
122+ GIT_EXTERN (int ) git_indexer_commit (git_indexer * idx , git_indexer_progress * stats );
82123
83124/**
84125 * Get the packfile's hash
0 commit comments