switch (data->version) {
case protocol_v2:
get_remote_refs(data->fd[1], &reader, &refs, for_push,
- ref_prefixes);
+ ref_prefixes, transport->server_options);
break;
case protocol_v1:
case protocol_v0:
args.no_dependents = data->options.no_dependents;
args.filter_options = data->options.filter_options;
args.stateless_rpc = transport->stateless_rpc;
+ args.server_options = transport->server_options;
if (!data->got_remote_heads)
refs_tmp = get_refs_via_connect(transport, 0, NULL);
struct git_transport_data *data;
if (!transport->smart_options)
- die("BUG: taking over transport requires non-NULL "
+ BUG("taking over transport requires non-NULL "
"smart_options field.");
data = xcalloc(1, sizeof(*data));
return from_user;
}
- die("BUG: invalid protocol_allow_config type");
+ BUG("invalid protocol_allow_config type");
}
void transport_check_allowed(const char *type)
int pretend = flags & TRANSPORT_PUSH_DRY_RUN;
int push_ret, ret, err;
struct argv_array ref_prefixes = ARGV_ARRAY_INIT;
- int i;
if (check_push_refs(local_refs, rs) < 0)
return -1;
- for (i = 0; i < rs->nr; i++) {
- const struct refspec_item *item = &rs->items[i];
- const char *prefix = NULL;
-
- if (item->dst)
- prefix = item->dst;
- else if (item->src && !item->exact_sha1)
- prefix = item->src;
-
- if (prefix) {
- const char *glob = strchr(prefix, '*');
- if (glob)
- argv_array_pushf(&ref_prefixes, "%.*s",
- (int)(glob - prefix),
- prefix);
- else
- expand_ref_prefix(&ref_prefixes, prefix);
- }
- }
+ refspec_ref_prefixes(rs, &ref_prefixes);
remote_refs = transport->vtable->get_refs_list(transport, 1,
&ref_prefixes);