aboutsummaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-25 13:38:44 -0700
committerJunio C Hamano <gitster@pobox.com>2008-05-25 13:41:37 -0700
commitb84c343c885b8168047b2773b5c597d04337d9bd (patch)
treea4ef0ee1fd0939d2a465d794ba0d88fc54234d28 /transport.c
parent0dbaa5bd514b9d234c07fd6b857888566abcf836 (diff)
parentb50c8469cc9a336b22ef37b23711d4547a48bc2b (diff)
downloadgit-b84c343c885b8168047b2773b5c597d04337d9bd.tar.gz
git-b84c343c885b8168047b2773b5c597d04337d9bd.tar.xz
Merge branch 'db/clone-in-c'
* db/clone-in-c: Add test for cloning with "--reference" repo being a subset of source repo Add a test for another combination of --reference Test that --reference actually suppresses fetching referenced objects clone: fall back to copying if hardlinking fails builtin-clone.c: Need to closedir() in copy_or_link_directory() builtin-clone: fix initial checkout Build in clone Provide API access to init_db() Add a function to set a non-default work tree Allow for having for_each_ref() list extra refs Have a constant extern refspec for "--tags" Add a library function to add an alternate to the alternates file Add a lockfile function to append to a file Mark the list of refs to fetch as const Conflicts: cache.h t/t5700-clone-reference.sh
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/transport.c b/transport.c
index 1bc16f2b6..3ff851935 100644
--- a/transport.c
+++ b/transport.c
@@ -203,7 +203,7 @@ static struct ref *get_refs_via_rsync(struct transport *transport)
}
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;
@@ -350,7 +350,7 @@ static int rsync_transport_push(struct transport *transport,
#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;
@@ -517,7 +517,7 @@ static struct ref *get_refs_via_curl(struct transport *transport)
}
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,
@@ -554,7 +554,7 @@ static struct ref *get_refs_from_bundle(struct transport *transport)
}
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);
@@ -628,7 +628,7 @@ static struct ref *get_refs_via_connect(struct transport *transport)
}
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));
@@ -796,12 +796,12 @@ const struct ref *transport_get_remote_refs(struct transport *transport)
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 &&