Commit 7506d34c0ca009a203aa649876707fed9ce3c901

Edward Thomson 2019-02-21T10:38:53

indexer: deprecate git_transfer_progress Safely deprecate `git_transfer_progress` and `git_transfer_progress_cb` types, forwarding them to the new `git_indexer_progress` and `git_indexer_progress_cb`.

diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 9d3a091..3777c0e 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -245,6 +245,35 @@ GIT_EXTERN(void) giterr_set_oom(void);
 
 /**@}*/
 
+/** @name Deprecated Transfer Progress Types
+ *
+ * These types are retained for backward compatibility.  The newer
+ * versions of these values should be preferred in all new code.
+ *
+ * There is no plan to remove these backward compatibility values at
+ * this time.
+ */
+/**@{*/
+
+/**
+ * This structure is used to provide callers information about the
+ * progress of indexing a packfile.
+ *
+ * This type is deprecated, but there is no plan to remove this
+ * type definition at this time.
+ */
+typedef git_indexer_progress git_transfer_progress;
+
+/**
+ * Type definition for progress callbacks during indexing.
+ *
+ * This type is deprecated, but there is no plan to remove this
+ * type definition at this time.
+ */
+typedef git_indexer_progress_cb git_transfer_progress_cb;
+
+/**@}*/
+
 /** @} */
 GIT_END_DECL
 
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 094a12b..47c0289 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -46,8 +46,6 @@ typedef struct git_indexer_progress {
 	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.
@@ -57,8 +55,6 @@ typedef git_indexer_progress git_transfer_progress;
  */
 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;