struct bundle_header header;
};
-static struct ref *get_refs_from_bundle(struct transport *transport, int for_push)
+static struct ref *get_refs_from_bundle(struct transport *transport,
+ int for_push,
+ const struct argv_array *ref_prefixes)
{
struct bundle_transport_data *data = transport->data;
struct ref *result = NULL;
return 0;
}
-static struct ref *get_refs_via_connect(struct transport *transport, int for_push)
+static struct ref *get_refs_via_connect(struct transport *transport, int for_push,
+ const struct argv_array *ref_prefixes)
{
struct git_transport_data *data = transport->data;
struct ref *refs = NULL;
data->version = discover_version(&reader);
switch (data->version) {
+ case protocol_v2:
+ get_remote_refs(data->fd[1], &reader, &refs, for_push,
+ ref_prefixes);
+ break;
case protocol_v1:
case protocol_v0:
get_remote_heads(&reader, &refs,
args.update_shallow = data->options.update_shallow;
if (!data->got_remote_heads)
- refs_tmp = get_refs_via_connect(transport, 0);
+ refs_tmp = get_refs_via_connect(transport, 0, NULL);
switch (data->version) {
+ case protocol_v2:
+ die("support for protocol v2 not implemented yet");
+ break;
case protocol_v1:
case protocol_v0:
refs = fetch_pack(&args, data->fd, data->conn,
int ret = 0;
if (!data->got_remote_heads)
- get_refs_via_connect(transport, 1);
+ get_refs_via_connect(transport, 1, NULL);
memset(&args, 0, sizeof(args));
args.send_mirror = !!(flags & TRANSPORT_PUSH_MIRROR);
args.push_cert = SEND_PACK_PUSH_CERT_NEVER;
switch (data->version) {
+ case protocol_v2:
+ die("support for protocol v2 not implemented yet");
+ break;
case protocol_v1:
case protocol_v0:
ret = send_pack(&args, data->fd, data->conn, remote_refs,
if (check_push_refs(local_refs, refspec_nr, refspec) < 0)
return -1;
- remote_refs = transport->vtable->get_refs_list(transport, 1);
+ remote_refs = transport->vtable->get_refs_list(transport, 1, NULL);
if (flags & TRANSPORT_PUSH_ALL)
match_flags |= MATCH_REFS_ALL;
return 1;
}
-const struct ref *transport_get_remote_refs(struct transport *transport)
+const struct ref *transport_get_remote_refs(struct transport *transport,
+ const struct argv_array *ref_prefixes)
{
if (!transport->got_remote_refs) {
- transport->remote_refs = transport->vtable->get_refs_list(transport, 0);
+ transport->remote_refs =
+ transport->vtable->get_refs_list(transport, 0,
+ ref_prefixes);
transport->got_remote_refs = 1;
}