Skip to content

Commit 975d672

Browse files
committed
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`.
1 parent 4069f92 commit 975d672

File tree

2 files changed

+45
-30
lines changed

2 files changed

+45
-30
lines changed

include/git2/indexer.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,51 @@ GIT_BEGIN_DECL
1515

1616
typedef 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+
typedef git_indexer_progress git_transfer_progress;
50+
51+
/**
52+
* Type for progress callbacks during indexing. Return a value less
53+
* than zero to cancel the indexing or download.
54+
*
55+
* @param stats Structure containing information about the state of the tran sfer
56+
* @param payload Payload provided by caller
57+
*/
58+
typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload);
59+
60+
typedef git_indexer_progress_cb git_transfer_progress_cb;
61+
62+
1863
typedef struct git_indexer_options {
1964
unsigned int version;
2065

include/git2/types.h

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -244,36 +244,6 @@ typedef struct git_push git_push;
244244
typedef struct git_remote_head git_remote_head;
245245
typedef struct git_remote_callbacks git_remote_callbacks;
246246

247-
/**
248-
* This is passed as the first argument to the callback to allow the
249-
* user to see the progress.
250-
*
251-
* - total_objects: number of objects in the packfile being downloaded
252-
* - indexed_objects: received objects that have been hashed
253-
* - received_objects: objects which have been downloaded
254-
* - local_objects: locally-available objects that have been injected
255-
* in order to fix a thin pack.
256-
* - received-bytes: size of the packfile received up to now
257-
*/
258-
typedef struct git_transfer_progress {
259-
unsigned int total_objects;
260-
unsigned int indexed_objects;
261-
unsigned int received_objects;
262-
unsigned int local_objects;
263-
unsigned int total_deltas;
264-
unsigned int indexed_deltas;
265-
size_t received_bytes;
266-
} git_transfer_progress;
267-
268-
/**
269-
* Type for progress callbacks during indexing. Return a value less than zero
270-
* to cancel the transfer.
271-
*
272-
* @param stats Structure containing information about the state of the transfer
273-
* @param payload Payload provided by caller
274-
*/
275-
typedef int GIT_CALLBACK(git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload);
276-
277247
/**
278248
* Type for messages delivered by the transport. Return a negative value
279249
* to cancel the network operation.

0 commit comments

Comments
 (0)