@@ -15,11 +15,52 @@ GIT_BEGIN_DECL
15
15
16
16
typedef struct git_indexer git_indexer ;
17
17
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
+
18
59
typedef struct git_indexer_options {
19
60
unsigned int version ;
20
61
21
62
/** progress_cb function to call with progress information */
22
- git_transfer_progress_cb progress_cb ;
63
+ git_indexer_progress_cb progress_cb ;
23
64
/** progress_cb_payload payload for the progress callback */
24
65
void * progress_cb_payload ;
25
66
@@ -69,7 +110,7 @@ GIT_EXTERN(int) git_indexer_new(
69
110
* @param size the size of the data in bytes
70
111
* @param stats stat storage
71
112
*/
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 );
73
114
74
115
/**
75
116
* Finalize the pack and index
@@ -78,7 +119,7 @@ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t si
78
119
*
79
120
* @param idx the indexer
80
121
*/
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 );
82
123
83
124
/**
84
125
* Get the packfile's hash
0 commit comments