Commit 975d6722a5c203427ab63789d329c00b76461225

Edward Thomson 2019-02-21T10:13:29

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`.

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.
  *