diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2021-12-24 15:14:38 -0600 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-01-06 15:18:33 -0500 |
commit | 6fc6eeb66c40310086c8f059cae41de69ad4c6da (patch) | |
tree | 0c5453c41d0886abb5eb35faeb2a0d180da91a6d /src/fetch.c | |
parent | f99a0d695c0a1a8e44fc1e5216d481ff016ec65d (diff) | |
download | libgit2-ethomson/remote_connect_opts.tar.gz |
remote: introduce `git_remote_connect_options`ethomson/remote_connect_opts
The existing mechanism for providing options to remote fetch/push calls,
and subsequently to transports, is unsatisfactory. It requires an
options structure to avoid breaking the API and callback signatures.
1. Introduce `git_remote_connect_options` to satisfy those needs.
2. Add a new remote connection API, `git_remote_connect_ext` that will
take this new options structure. Existing `git_remote_connect` calls
will proxy to that. `git_remote_fetch` and `git_remote_push` will
proxy their fetch/push options to that as well.
3. Define the interaction between `git_remote_connect` and fetch/push.
Connect _may_ be called before fetch/push, but _need not_ be. The
semantics of which options would be used for these operations was
not specified if you specify options for both connect _and_ fetch.
Now these are defined that the fetch or push options will be used
_if_ they were specified. Otherwise, the connect options will be
used if they were specified. Otherwise, the library's defaults will
be used.
4. Update the transports to understand `git_remote_connect_options`.
This is a breaking change to the systems API.
Diffstat (limited to 'src/fetch.c')
-rw-r--r-- | src/fetch.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/fetch.c b/src/fetch.c index bc5961db4..117c8f26f 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -134,21 +134,14 @@ int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts) remote->refs.length); } -int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *callbacks) +int git_fetch_download_pack(git_remote *remote) { git_transport *t = remote->transport; - git_indexer_progress_cb progress = NULL; - void *payload = NULL; if (!remote->need_pack) return 0; - if (callbacks) { - progress = callbacks->transfer_progress; - payload = callbacks->payload; - } - - return t->download_pack(t, remote->repo, &remote->stats, progress, payload); + return t->download_pack(t, remote->repo, &remote->stats); } int git_fetch_options_init(git_fetch_options *opts, unsigned int version) |