diff options
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/transport.c b/transport.c index 679a35e7c1..1c4ab676d1 100644 --- a/transport.c +++ b/transport.c @@ -127,7 +127,7 @@ struct bundle_transport_data { static struct ref *get_refs_from_bundle(struct transport *transport, int for_push, - const struct strvec *ref_prefixes) + struct transport_ls_refs_options *transport_options) { struct bundle_transport_data *data = transport->data; struct ref *result = NULL; @@ -280,7 +280,7 @@ static void die_if_server_options(struct transport *transport) * remote refs. */ static struct ref *handshake(struct transport *transport, int for_push, - const struct strvec *ref_prefixes, + struct transport_ls_refs_options *options, int must_list_refs) { struct git_transport_data *data = transport->data; @@ -303,7 +303,7 @@ static struct ref *handshake(struct transport *transport, int for_push, trace2_data_string("transfer", NULL, "server-sid", server_sid); if (must_list_refs) get_remote_refs(data->fd[1], &reader, &refs, for_push, - ref_prefixes, + options, transport->server_options, transport->stateless_rpc); break; @@ -334,9 +334,9 @@ static struct ref *handshake(struct transport *transport, int for_push, } static struct ref *get_refs_via_connect(struct transport *transport, int for_push, - const struct strvec *ref_prefixes) + struct transport_ls_refs_options *options) { - return handshake(transport, for_push, ref_prefixes, 1); + return handshake(transport, for_push, options, 1); } static int fetch_refs_via_pack(struct transport *transport, @@ -871,7 +871,7 @@ void transport_take_over(struct transport *transport, BUG("taking over transport requires non-NULL " "smart_options field."); - data = xcalloc(1, sizeof(*data)); + CALLOC_ARRAY(data, 1); data->options = *transport->smart_options; data->conn = child; data->fd[0] = data->conn->out; @@ -1252,19 +1252,20 @@ int transport_push(struct repository *r, int porcelain = flags & TRANSPORT_PUSH_PORCELAIN; int pretend = flags & TRANSPORT_PUSH_DRY_RUN; int push_ret, ret, err; - struct strvec ref_prefixes = STRVEC_INIT; + struct transport_ls_refs_options transport_options = + TRANSPORT_LS_REFS_OPTIONS_INIT; if (check_push_refs(local_refs, rs) < 0) return -1; - refspec_ref_prefixes(rs, &ref_prefixes); + refspec_ref_prefixes(rs, &transport_options.ref_prefixes); trace2_region_enter("transport_push", "get_refs_list", r); remote_refs = transport->vtable->get_refs_list(transport, 1, - &ref_prefixes); + &transport_options); trace2_region_leave("transport_push", "get_refs_list", r); - strvec_clear(&ref_prefixes); + strvec_clear(&transport_options.ref_prefixes); if (flags & TRANSPORT_PUSH_ALL) match_flags |= MATCH_REFS_ALL; @@ -1380,12 +1381,12 @@ int transport_push(struct repository *r, } const struct ref *transport_get_remote_refs(struct transport *transport, - const struct strvec *ref_prefixes) + struct transport_ls_refs_options *transport_options) { if (!transport->got_remote_refs) { transport->remote_refs = transport->vtable->get_refs_list(transport, 0, - ref_prefixes); + transport_options); transport->got_remote_refs = 1; } |