Skip to content

Commit 7138ce3

Browse files
author
Carson Howard
committed
remote: add typedef to normalize push_update_reference callback
Very many callbacks in libgit2 have some sort of typedef to normalize the name at git_<name_of_operation>_cb. Add a typedef for push_update_references in the remote so the name follows the same conventions.
1 parent 62ac393 commit 7138ce3

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

include/git2/remote.h

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,20 @@ typedef struct {
385385
*/
386386
typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload);
387387

388+
/**
389+
* Callback used to inform of the update status from the remote.
390+
*
391+
* Called for each updated reference on push. If `status` is
392+
* not `NULL`, the update was rejected by the remote server
393+
* and `status` contains the reason given.
394+
*
395+
* @param refname refname specifying to the remote ref
396+
* @param status status message sent from the remote
397+
* @param data data provided by the caller
398+
* @return 0 on success, otherwise an error
399+
*/
400+
typedef int (*git_push_update_reference_cb)(const char *refname, const char *status, void *data);
401+
388402
/**
389403
* The callback settings structure
390404
*
@@ -452,11 +466,9 @@ struct git_remote_callbacks {
452466
git_push_transfer_progress push_transfer_progress;
453467

454468
/**
455-
* Called for each updated reference on push. If `status` is
456-
* not `NULL`, the update was rejected by the remote server
457-
* and `status` contains the reason given.
469+
* See documentation of git_push_update_reference_cb
458470
*/
459-
int (*push_update_reference)(const char *refname, const char *status, void *data);
471+
git_push_update_reference_cb push_update_reference;
460472

461473
/**
462474
* Called once between the negotiation step and the upload. It

0 commit comments

Comments
 (0)