diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/push.h | 110 | ||||
-rw-r--r-- | include/git2/remote.h | 15 |
2 files changed, 14 insertions, 111 deletions
diff --git a/include/git2/push.h b/include/git2/push.h index 7bd1377e9..ecabff397 100644 --- a/include/git2/push.h +++ b/include/git2/push.h @@ -59,116 +59,6 @@ typedef int (*git_push_transfer_progress)( size_t bytes, void* payload); -/** - * Create a new push object - * - * @param out New push object - * @param remote Remote instance - * - * @return 0 or an error code - */ -GIT_EXTERN(int) git_push_new(git_push **out, git_remote *remote); - -/** - * Set options on a push object - * - * @param push The push object - * @param opts The options to set on the push object - * - * @return 0 or an error code - */ -GIT_EXTERN(int) git_push_set_options( - git_push *push, - const git_push_options *opts); - -/** - * Set the callbacks for a push - * - * @param push The push object - * @param pack_progress_cb Function to call with progress information during - * pack building. Be aware that this is called inline with pack building - * operations, so performance may be affected. - * @param pack_progress_cb_payload Payload for the pack progress callback. - * @param transfer_progress_cb Function to call with progress information during - * the upload portion of a push. Be aware that this is called inline with - * pack building operations, so performance may be affected. - * @param transfer_progress_cb_payload Payload for the network progress callback. - * @return 0 or an error code - */ -GIT_EXTERN(int) git_push_set_callbacks( - git_push *push, - git_packbuilder_progress pack_progress_cb, - void *pack_progress_cb_payload, - git_push_transfer_progress transfer_progress_cb, - void *transfer_progress_cb_payload); - -/** - * Add a refspec to be pushed - * - * @param push The push object - * @param refspec Refspec string - * - * @return 0 or an error code - */ -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, - const git_signature *signature, - const char *reflog_message); - -/** - * Perform the push - * - * This function will return an error in case of a protocol error or - * the server being unable to unpack the data we sent. - * - * The return value does not reflect whether the server accepted or - * refused any reference updates. Use `git_push_status_foreach()` in - * order to find out which updates were accepted or rejected. - * - * @param push The push object - * - * @return 0 or an error code - */ -GIT_EXTERN(int) git_push_finish(git_push *push); - -/** - * 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>`. - * `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, 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), - void *data); - -/** - * Free the given push object - * - * @param push The push object - */ -GIT_EXTERN(void) git_push_free(git_push *push); - /** @} */ GIT_END_DECL #endif diff --git a/include/git2/remote.h b/include/git2/remote.h index 15a8d481f..452e556dd 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -320,6 +320,19 @@ GIT_EXTERN(int) git_remote_ls(const git_remote_head ***out, size_t *size, git_r GIT_EXTERN(int) git_remote_download(git_remote *remote, const git_strarray *refspecs); /** + * Create a packfile and send it to the server + * + * Connect to the remote if it hasn't been done yet, negotiate with + * the remote git which objects are missing, create a packfile with the missing objects and send it. + * + * @param remote the remote + * @param refspecs the refspecs to use for this negotiation and + * upload. Use NULL or an empty array to use the base refspecs + * @return 0 or an error code + */ +GIT_EXTERN(int) git_remote_upload(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts); + +/** * Check whether the remote is connected * * Check whether the remote's underlying transport is connected to the @@ -407,7 +420,7 @@ GIT_EXTERN(int) git_remote_fetch( * @param reflog_message message to use for the reflog of upated references */ GIT_EXTERN(int) git_remote_push(git_remote *remote, - git_strarray *refspecs, + const git_strarray *refspecs, const git_push_options *opts, const git_signature *signature, const char *reflog_message); |