struct bundle_transport_data {
int fd;
struct bundle_header header;
+ unsigned get_refs_from_bundle_called : 1;
};
static struct ref *get_refs_from_bundle(struct transport *transport,
if (for_push)
return NULL;
+ data->get_refs_from_bundle_called = 1;
+
if (data->fd > 0)
close(data->fd);
data->fd = read_bundle_header(transport->url, &data->header);
int nr_heads, struct ref **to_fetch)
{
struct bundle_transport_data *data = transport->data;
+
+ if (!data->get_refs_from_bundle_called)
+ get_refs_from_bundle(transport, 0, NULL);
return unbundle(the_repository, &data->header, data->fd,
transport->progress ? BUNDLE_VERBOSE : 0);
}
opts->no_dependents = !!value;
return 0;
} else if (!strcmp(name, TRANS_OPT_LIST_OBJECTS_FILTER)) {
+ list_objects_filter_die_if_populated(&opts->filter_options);
parse_list_objects_filter(&opts->filter_options, value);
return 0;
}
}
static struct transport_vtable taken_over_vtable = {
- 1,
NULL,
get_refs_via_connect,
fetch_refs_via_pack,
}
static struct transport_vtable bundle_vtable = {
- 0,
NULL,
get_refs_from_bundle,
fetch_refs_from_bundle,
};
static struct transport_vtable builtin_smart_vtable = {
- 1,
NULL,
get_refs_via_connect,
fetch_refs_via_pack,
refspec_ref_prefixes(rs, &ref_prefixes);
+ trace2_region_enter("transport_push", "get_refs_list", r);
remote_refs = transport->vtable->get_refs_list(transport, 1,
&ref_prefixes);
+ trace2_region_leave("transport_push", "get_refs_list", r);
argv_array_clear(&ref_prefixes);
struct ref *ref = remote_refs;
struct oid_array commits = OID_ARRAY_INIT;
+ trace2_region_enter("transport_push", "push_submodules", r);
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
oid_array_append(&commits,
transport->push_options,
pretend)) {
oid_array_clear(&commits);
+ trace2_region_leave("transport_push", "push_submodules", r);
die(_("failed to push all needed submodules"));
}
oid_array_clear(&commits);
+ trace2_region_leave("transport_push", "push_submodules", r);
}
if (((flags & TRANSPORT_RECURSE_SUBMODULES_CHECK) ||
struct string_list needs_pushing = STRING_LIST_INIT_DUP;
struct oid_array commits = OID_ARRAY_INIT;
+ trace2_region_enter("transport_push", "check_submodules", r);
for (; ref; ref = ref->next)
if (!is_null_oid(&ref->new_oid))
oid_array_append(&commits,
transport->remote->name,
&needs_pushing)) {
oid_array_clear(&commits);
+ trace2_region_leave("transport_push", "check_submodules", r);
die_with_unpushed_submodules(&needs_pushing);
}
string_list_clear(&needs_pushing, 0);
oid_array_clear(&commits);
+ trace2_region_leave("transport_push", "check_submodules", r);
}
- if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY))
+ if (!(flags & TRANSPORT_RECURSE_SUBMODULES_ONLY)) {
+ trace2_region_enter("transport_push", "push_refs", r);
push_ret = transport->vtable->push_refs(transport, remote_refs, flags);
- else
+ trace2_region_leave("transport_push", "push_refs", r);
+ } else
push_ret = 0;
err = push_had_errors(remote_refs);
ret = push_ret | err;
struct ref **heads = NULL;
struct ref *rm;
- if (!transport->vtable->fetch_without_list)
- /*
- * Some transports (e.g. the built-in bundle transport and the
- * transport helper interface) do not work when fetching is
- * done immediately after transport creation. List the remote
- * refs anyway (if not already listed) as a workaround.
- */
- transport_get_remote_refs(transport, NULL);
-
for (rm = refs; rm; rm = rm->next) {
nr_refs++;
if (rm->peer_ref &&