diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-04-21 22:10:36 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-13 09:46:35 +0200 |
| commit | 8f0104ecc54db00a075310ab744a19eb60e3d740 (patch) | |
| tree | 775b3237a853c556a4d44840fc6c562e7b114415 /include/git2/push.h | |
| parent | 05259114427234831cf4915cbe40a5bb8ea021b0 (diff) | |
| download | libgit2-8f0104ecc54db00a075310ab744a19eb60e3d740.tar.gz | |
Remove the callbacks struct from the remote
Having the setting be different from calling its actions was not a great
idea and made for the sake of the wrong convenience.
Instead of that, accept either fetch options, push options or the
callbacks when dealing with the remote. The fetch options are currently
only the callbacks, but more options will be moved from setters and
getters on the remote to the options.
This does mean passing the same struct along the different functions but
the typical use-case will only call git_remote_fetch() or
git_remote_push() and so won't notice much difference.
Diffstat (limited to 'include/git2/push.h')
| -rw-r--r-- | include/git2/push.h | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/include/git2/push.h b/include/git2/push.h deleted file mode 100644 index 3f850453d..000000000 --- a/include/git2/push.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) the libgit2 contributors. All rights reserved. - * - * This file is part of libgit2, distributed under the GNU GPL v2 with - * a Linking Exception. For full terms see the included COPYING file. - */ -#ifndef INCLUDE_git_push_h__ -#define INCLUDE_git_push_h__ - -#include "common.h" -#include "pack.h" - -/** - * @file git2/push.h - * @brief Git push management functions - * @defgroup git_push push management functions - * @ingroup Git - * @{ - */ -GIT_BEGIN_DECL - -/** - * Controls the behavior of a git_push object. - */ -typedef struct { - unsigned int version; - - /** - * If the transport being used to push to the remote requires the creation - * of a pack file, this controls the number of worker threads used by - * the packbuilder when creating that pack file to be sent to the remote. - * - * If set to 0, the packbuilder will auto-detect the number of threads - * to create. The default value is 1. - */ - unsigned int pb_parallelism; -} git_push_options; - -#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, - unsigned int version); - -/** Push network progress notification function */ -typedef int (*git_push_transfer_progress)( - unsigned int current, - unsigned int total, - size_t bytes, - void* payload); - -/** - * Represents an update which will be performed on the remote during push - */ -typedef struct { - /** - * The source name of the reference - */ - char *src_refname; - /** - * The name of the reference to update on the server - */ - char *dst_refname; - /** - * The current target of the reference - */ - git_oid src; - /** - * The new target for the reference - */ - git_oid dst; -} git_push_update; - -/** - * @param updates an array containing the updates which will be sent - * as commands to the destination. - * @param len number of elements in `updates` - * @param payload Payload provided by the caller - */ -typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload); - -/** @} */ -GIT_END_DECL -#endif |
