summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-02-21 10:13:29 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2019-02-22 11:25:14 +0000
commit975d6722a5c203427ab63789d329c00b76461225 (patch)
tree140a2845b3092645930d87e43731cca8d9277cb5 /include
parent4069f924855d596871a7e1f16c5c3f67a16dd5f4 (diff)
downloadlibgit2-975d6722a5c203427ab63789d329c00b76461225.tar.gz
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`.
Diffstat (limited to 'include')
-rw-r--r--include/git2/indexer.h45
-rw-r--r--include/git2/types.h30
2 files changed, 45 insertions, 30 deletions
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 94d8785c0..a65d9d710 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 0eaa0041d..9b384ca13 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.
*