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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 94d8785..a65d9d7 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;
diff --git a/include/git2/types.h b/include/git2/types.h
index 0eaa004..9b384ca 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -245,36 +245,6 @@ typedef struct git_remote_head git_remote_head;
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;
-
-/**
- * Type for progress callbacks during indexing. Return a value less than zero
- * to cancel the transfer.
- *
- * @param stats Structure containing information about the state of the transfer
- * @param payload Payload provided by caller
- */
-typedef int GIT_CALLBACK(git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload);
-
-/**
* Type for messages delivered by the transport. Return a negative value
* to cancel the network operation.
*