summaryrefslogtreecommitdiff
path: root/src/transports/smart.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-12-24 15:14:38 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2022-01-06 15:18:33 -0500
commit6fc6eeb66c40310086c8f059cae41de69ad4c6da (patch)
tree0c5453c41d0886abb5eb35faeb2a0d180da91a6d /src/transports/smart.h
parentf99a0d695c0a1a8e44fc1e5216d481ff016ec65d (diff)
downloadlibgit2-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/transports/smart.h')
-rw-r--r--src/transports/smart.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/transports/smart.h b/src/transports/smart.h
index a9cab31ac..726bf40b4 100644
--- a/src/transports/smart.h
+++ b/src/transports/smart.h
@@ -137,16 +137,8 @@ typedef struct {
git_transport parent;
git_remote *owner;
char *url;
- git_credential_acquire_cb cred_acquire_cb;
- void *cred_acquire_payload;
- git_proxy_options proxy;
+ git_remote_connect_options connect_opts;
int direction;
- int flags;
- git_transport_message_cb progress_cb;
- git_transport_message_cb error_cb;
- git_transport_certificate_check_cb certificate_check_cb;
- void *message_cb_payload;
- git_strarray custom_headers;
git_smart_subtransport *wrapped;
git_smart_subtransport_stream *current_stream;
transport_smart_caps caps;
@@ -157,8 +149,8 @@ typedef struct {
packetsize_cb packetsize_cb;
void *packetsize_payload;
unsigned rpc : 1,
- have_refs : 1,
- connected : 1;
+ have_refs : 1,
+ connected : 1;
gitno_buffer buffer;
char buffer_data[65536];
} transport_smart;
@@ -166,7 +158,7 @@ typedef struct {
/* smart_protocol.c */
int git_smart__store_refs(transport_smart *t, int flushes);
int git_smart__detect_caps(git_pkt_ref *pkt, transport_smart_caps *caps, git_vector *symrefs);
-int git_smart__push(git_transport *transport, git_push *push, const git_remote_callbacks *cbs);
+int git_smart__push(git_transport *transport, git_push *push);
int git_smart__negotiate_fetch(
git_transport *transport,
@@ -177,9 +169,7 @@ int git_smart__negotiate_fetch(
int git_smart__download_pack(
git_transport *transport,
git_repository *repo,
- git_indexer_progress *stats,
- git_indexer_progress_cb progress_cb,
- void *progress_payload);
+ git_indexer_progress *stats);
/* smart.c */
int git_smart__negotiation_step(git_transport *transport, void *data, size_t len);