From 9effa2fb72f20332c2c8a83540bb224a32e0265b Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Sun, 20 Apr 2014 19:19:13 +0200 Subject: Fire progress callbacks also for pushes. It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why. --- include/git2/remote.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/git2') diff --git a/include/git2/remote.h b/include/git2/remote.h index d57321f03..88040d49c 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -455,7 +455,8 @@ struct git_remote_callbacks { /** * Textual progress from the remote. Text send over the * progress side-band will be passed to this function (this is - * the 'counting objects' output. + * the 'counting objects' output. This callback should return a value less + * than zero to cancel the operation. */ int (*progress)(const char *str, int len, void *data); -- cgit v1.2.1 From 4f62163ead2bde1af3cd7d0c0b8990e1831d3ffd Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Sun, 20 Apr 2014 22:06:05 +0200 Subject: Check the return codes of remote callbacks. The user may have requested that the operation be cancelled. --- include/git2/remote.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/git2') diff --git a/include/git2/remote.h b/include/git2/remote.h index 88040d49c..d57321f03 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -455,8 +455,7 @@ struct git_remote_callbacks { /** * Textual progress from the remote. Text send over the * progress side-band will be passed to this function (this is - * the 'counting objects' output. This callback should return a value less - * than zero to cancel the operation. + * the 'counting objects' output. */ int (*progress)(const char *str, int len, void *data); -- cgit v1.2.1 From 98020d3a73743d79c6acd380339b1d743205a86b Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Mon, 21 Apr 2014 10:55:37 +0200 Subject: Rename progress callback to sideband_progress --- include/git2/remote.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2') diff --git a/include/git2/remote.h b/include/git2/remote.h index d57321f03..06fc8e90d 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -457,7 +457,7 @@ struct git_remote_callbacks { * progress side-band will be passed to this function (this is * the 'counting objects' output. */ - int (*progress)(const char *str, int len, void *data); + int (*sideband_progress)(const char *str, int len, void *data); /** * Completion is called when different parts of the download -- cgit v1.2.1 From 48e60ae75e78bc58aeb3c7ecf6be4653152182f4 Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Mon, 21 Apr 2014 11:23:29 +0200 Subject: Don't redefine the same callback types, their signatures may change --- include/git2/indexer.h | 2 +- include/git2/odb.h | 2 +- include/git2/pack.h | 2 +- include/git2/remote.h | 6 +++--- include/git2/sys/odb_backend.h | 2 +- include/git2/transport.h | 2 +- include/git2/types.h | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'include/git2') diff --git a/include/git2/indexer.h b/include/git2/indexer.h index e4c03ad06..d2d315e47 100644 --- a/include/git2/indexer.h +++ b/include/git2/indexer.h @@ -32,7 +32,7 @@ GIT_EXTERN(int) git_indexer_new( const char *path, unsigned int mode, git_odb *odb, - git_transfer_progress_callback progress_cb, + git_transfer_progress_cb progress_cb, void *progress_cb_payload); /** diff --git a/include/git2/odb.h b/include/git2/odb.h index c71e30648..114f6b317 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -338,7 +338,7 @@ GIT_EXTERN(int) git_odb_open_rstream(git_odb_stream **out, git_odb *db, const gi GIT_EXTERN(int) git_odb_write_pack( git_odb_writepack **out, git_odb *db, - git_transfer_progress_callback progress_cb, + git_transfer_progress_cb progress_cb, void *progress_payload); /** diff --git a/include/git2/pack.h b/include/git2/pack.h index 29c926c65..e7f060d12 100644 --- a/include/git2/pack.h +++ b/include/git2/pack.h @@ -140,7 +140,7 @@ GIT_EXTERN(int) git_packbuilder_write( git_packbuilder *pb, const char *path, unsigned int mode, - git_transfer_progress_callback progress_cb, + git_transfer_progress_cb progress_cb, void *progress_cb_payload); /** diff --git a/include/git2/remote.h b/include/git2/remote.h index 06fc8e90d..ebd83c05a 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -457,7 +457,7 @@ struct git_remote_callbacks { * progress side-band will be passed to this function (this is * the 'counting objects' output. */ - int (*sideband_progress)(const char *str, int len, void *data); + git_transport_message_cb sideband_progress; /** * Completion is called when different parts of the download @@ -469,14 +469,14 @@ struct git_remote_callbacks { * This will be called if the remote host requires * authentication in order to connect to it. */ - int (*credentials)(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *data); + git_cred_acquire_cb credentials; /** * During the download of new data, this will be regularly * called with the current count of progress done by the * indexer. */ - int (*transfer_progress)(const git_transfer_progress *stats, void *data); + git_transfer_progress_cb transfer_progress; /** * Each time a reference is updated locally, this function diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h index 81bb082e6..77fe0dd31 100644 --- a/include/git2/sys/odb_backend.h +++ b/include/git2/sys/odb_backend.h @@ -81,7 +81,7 @@ struct git_odb_backend { int (* writepack)( git_odb_writepack **, git_odb_backend *, git_odb *odb, - git_transfer_progress_callback progress_cb, void *progress_payload); + git_transfer_progress_cb progress_cb, void *progress_payload); void (* free)(git_odb_backend *); }; diff --git a/include/git2/transport.h b/include/git2/transport.h index 1665f97b3..a33146ca8 100644 --- a/include/git2/transport.h +++ b/include/git2/transport.h @@ -287,7 +287,7 @@ struct git_transport { git_transport *transport, git_repository *repo, git_transfer_progress *stats, - git_transfer_progress_callback progress_cb, + git_transfer_progress_cb progress_cb, void *progress_payload); /* Checks to see if the transport is connected */ diff --git a/include/git2/types.h b/include/git2/types.h index 9db59b16b..1b6f4cca1 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -241,7 +241,7 @@ typedef struct git_transfer_progress { * @param stats Structure containing information about the state of the transfer * @param payload Payload provided by caller */ -typedef int (*git_transfer_progress_callback)(const git_transfer_progress *stats, void *payload); +typedef int (*git_transfer_progress_cb)(const git_transfer_progress *stats, void *payload); /** * Opaque structure representing a submodule. -- cgit v1.2.1