From 373cf6a932a64d1cbe5f5cd8333546dcc2ca0b92 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Mon, 9 Dec 2013 10:17:47 -0800 Subject: Update docs for new callback return value behavior --- include/git2/push.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index 77ef74039..12f0e7f2c 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -132,17 +132,19 @@ GIT_EXTERN(int) git_push_finish(git_push *push); GIT_EXTERN(int) git_push_unpack_ok(git_push *push); /** - * Call callback `cb' on each status + * Invoke callback `cb' on each status entry * * For each of the updated references, we receive a status report in the * form of `ok refs/heads/master` or `ng refs/heads/master `. * `msg != NULL` means the reference has not been updated for the given * reason. * + * Return a non-zero value from the callback to stop the loop. + * * @param push The push object * @param cb The callback to call on each object * - * @return 0 on success, GIT_EUSER on non-zero callback, or error code + * @return 0 on success, non-zero callback return value, or error code */ GIT_EXTERN(int) git_push_status_foreach(git_push *push, int (*cb)(const char *ref, const char *msg, void *data), -- cgit v1.2.3 From 491cecfe8ce4c6fbee3357248c7b688b6e1aaab4 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Tue, 4 Feb 2014 20:13:50 -0800 Subject: Add reflog parameters to git_push_update_tips --- include/git2/push.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index 12f0e7f2c..c98c6d96e 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -103,10 +103,16 @@ GIT_EXTERN(int) git_push_add_refspec(git_push *push, const char *refspec); * Update remote tips after a push * * @param push The push object + * @param signature The identity to use when updating reflogs + * @param reflog_message The message to insert into the reflogs. If NULL, the + * default is "update by push". * * @return 0 or an error code */ -GIT_EXTERN(int) git_push_update_tips(git_push *push); +GIT_EXTERN(int) git_push_update_tips( + git_push *push, + const git_signature *signature, + const char *reflog_message); /** * Actually push all given refspecs -- cgit v1.2.3 From 2bfc673910d3f47395456bb6842e6bed473b8e68 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Thu, 6 Feb 2014 10:39:57 -0800 Subject: Fix terrible indentation --- include/git2/push.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index c98c6d96e..67702aca2 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -105,7 +105,7 @@ GIT_EXTERN(int) git_push_add_refspec(git_push *push, const char *refspec); * @param push The push object * @param signature The identity to use when updating reflogs * @param reflog_message The message to insert into the reflogs. If NULL, the - * default is "update by push". + * default is "update by push". * * @return 0 or an error code */ -- cgit v1.2.3 From b9f819978c571cc806827e8b3ebc1a58a0755999 Mon Sep 17 00:00:00 2001 From: Matthew Bowen Date: Wed, 5 Mar 2014 21:49:23 -0500 Subject: Added function-based initializers for every options struct. The basic structure of each function is courtesy of arrbee. --- include/git2/push.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index 67702aca2..899d21e7f 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -39,6 +39,19 @@ typedef struct { #define GIT_PUSH_OPTIONS_VERSION 1 #define GIT_PUSH_OPTIONS_INIT { GIT_PUSH_OPTIONS_VERSION } +/** + * Initializes a `git_push_options` with default values. Equivalent to + * creating an instance with GIT_PUSH_OPTIONS_INIT. + * + * @param opts the `git_push_options` instance to initialize. + * @param version the version of the struct; you should pass + * `GIT_PUSH_OPTIONS_VERSION` here. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_push_init_options( + git_push_options* opts, + int version); + /** Push network progress notification function */ typedef int (*git_push_transfer_progress)( unsigned int current, -- cgit v1.2.3 From 3b4ba2787049c561cd7a9e3fea8fc16e473a0b32 Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Thu, 3 Apr 2014 15:50:21 +0200 Subject: Const correctness! --- include/git2/push.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index 899d21e7f..7a8bec12c 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -148,7 +148,7 @@ GIT_EXTERN(int) git_push_finish(git_push *push); * * @return true if remote side successfully unpacked, false otherwise */ -GIT_EXTERN(int) git_push_unpack_ok(git_push *push); +GIT_EXTERN(int) git_push_unpack_ok(const git_push *push); /** * Invoke callback `cb' on each status entry -- cgit v1.2.3 From 702efc891f2a620f10998062ba0c00b34100f632 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Wed, 30 Apr 2014 10:57:42 -0700 Subject: Make init_options fns use unsigned ints and macro Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string). --- include/git2/push.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/git2/push.h') diff --git a/include/git2/push.h b/include/git2/push.h index 7a8bec12c..cbf115661 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -49,8 +49,8 @@ typedef struct { * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_push_init_options( - git_push_options* opts, - int version); + git_push_options *opts, + unsigned int version); /** Push network progress notification function */ typedef int (*git_push_transfer_progress)( -- cgit v1.2.3