}
static int fetch_objs_via_rsync(struct transport *transport,
- int nr_objs, struct ref **to_fetch)
+ int nr_objs, const struct ref **to_fetch)
{
struct strbuf buf = STRBUF_INIT;
struct child_process rsync;
#ifndef NO_CURL /* http fetch is the only user */
static int fetch_objs_via_walker(struct transport *transport,
- int nr_objs, struct ref **to_fetch)
+ int nr_objs, const struct ref **to_fetch)
{
char *dest = xstrdup(transport->url);
struct walker *walker = transport->data;
}
static int fetch_objs_via_curl(struct transport *transport,
- int nr_objs, struct ref **to_fetch)
+ int nr_objs, const struct ref **to_fetch)
{
if (!transport->data)
transport->data = get_http_walker(transport->url,
}
static int fetch_refs_from_bundle(struct transport *transport,
- int nr_heads, struct ref **to_fetch)
+ int nr_heads, const struct ref **to_fetch)
{
struct bundle_transport_data *data = transport->data;
return unbundle(&data->header, data->fd);
}
static int fetch_refs_via_pack(struct transport *transport,
- int nr_heads, struct ref **to_fetch)
+ int nr_heads, const struct ref **to_fetch)
{
struct git_transport_data *data = transport->data;
char **heads = xmalloc(nr_heads * sizeof(*heads));
{
const char *colon = strchr(url, ':');
const char *slash = strchr(url, '/');
- return !colon || (slash && slash < colon);
+ return !colon || (slash && slash < colon) ||
+ has_dos_drive_prefix(url);
}
static int is_file(const char *url)
return transport->remote_refs;
}
-int transport_fetch_refs(struct transport *transport, struct ref *refs)
+int transport_fetch_refs(struct transport *transport, const struct ref *refs)
{
int rc;
int nr_heads = 0, nr_alloc = 0;
- struct ref **heads = NULL;
- struct ref *rm;
+ const struct ref **heads = NULL;
+ const struct ref *rm;
for (rm = refs; rm; rm = rm->next) {
if (rm->peer_ref &&