summaryrefslogtreecommitdiff
path: root/include/git2/remote.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/remote.h')
-rw-r--r--include/git2/remote.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 5c01949d..dc6642cc 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -190,7 +190,7 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote);
* @param remote the remote to update
* @param cb callback to run on each ref update. 'a' is the old value, 'b' is then new value
*/
-GIT_EXTERN(int) git_remote_update_tips(git_remote *remote, int (*cb)(const char *refname, const git_oid *a, const git_oid *b));
+GIT_EXTERN(int) git_remote_update_tips(git_remote *remote);
/**
* Return whether a string is a valid remote URL
@@ -238,6 +238,39 @@ GIT_EXTERN(int) git_remote_add(git_remote **out, git_repository *repo, const cha
GIT_EXTERN(void) git_remote_check_cert(git_remote *remote, int check);
+/**
+ * Argument to the completion callback which tells it which operation
+ * finished.
+ */
+typedef enum git_remote_completion_type {
+ GIT_REMOTE_COMPLETION_DOWNLOAD,
+ GIT_REMOTE_COMPLETION_INDEXING,
+ GIT_REMOTE_COMPLETION_ERROR,
+} git_remote_completion_type;
+
+/**
+ * The callback settings structure
+ *
+ * Set the calbacks to be called by the remote.
+ */
+struct git_remote_callbacks {
+ int (*progress)(const char *str, void *data);
+ int (*completion)(git_remote_completion_type type, void *data);
+ int (*update_tips)(const char *refname, const git_oid *a, const git_oid *b, void *data);
+ void *data;
+};
+
+/**
+ * Set the callbacks for a remote
+ *
+ * Note that the remote keeps its own copy of the data and you need to
+ * call this function again if you want to change the callbacks.
+ *
+ * @param remote the remote to configure
+ * @param callbacks a pointer to the user's callback settings
+ */
+GIT_EXTERN(void) git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callbacks);
+
/** @} */
GIT_END_DECL
#endif