diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2017-10-07 00:26:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-07 00:26:21 +0100 |
commit | 668fa071ffcf11a6d706a5df66a7ddaadec4ba4a (patch) | |
tree | e1996f4886dd3b6d733c472c9dd7db6c6de3fa3d | |
parent | e2e3943db59e034cfbe082b321fe6205576ce348 (diff) | |
parent | 7138ce370b0b39c53249c7ec6804e197c0080c22 (diff) | |
download | libgit2-668fa071ffcf11a6d706a5df66a7ddaadec4ba4a.tar.gz |
Merge pull request #4363 from cjhoward92/typedef-push-update-reference
remote: add typedef to normalize push_update_reference callback
-rw-r--r-- | include/git2/remote.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h index b1e04d557..22e2291d0 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -386,6 +386,20 @@ typedef struct { typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload); /** + * Callback used to inform of the update status from the remote. + * + * Called for each updated reference on push. If `status` is + * not `NULL`, the update was rejected by the remote server + * and `status` contains the reason given. + * + * @param refname refname specifying to the remote ref + * @param status status message sent from the remote + * @param data data provided by the caller + * @return 0 on success, otherwise an error + */ +typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data); + +/** * The callback settings structure * * Set the callbacks to be called by the remote when informing the user @@ -452,11 +466,9 @@ struct git_remote_callbacks { git_push_transfer_progress push_transfer_progress; /** - * Called for each updated reference on push. If `status` is - * not `NULL`, the update was rejected by the remote server - * and `status` contains the reason given. + * See documentation of git_push_update_reference_cb */ - int (*push_update_reference)(const char *refname, const char *status, void *data); + git_push_update_reference_cb push_update_reference; /** * Called once between the negotiation step and the upload. It |