summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorIlari Liusvaara <ilari.liusvaara@elisanet.fi>2010-01-27 17:53:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-01-27 20:05:04 (GMT)
commit4da504608ea94fbcac65eb287d8d5791bddefd88 (patch)
treeb539aaa5ab90cd4e8594c456f76fa0fff509bfd2 /transport.c
parentd539de9f25920f099e4e56b0acbb4ebf246ff0f4 (diff)
downloadgit-4da504608ea94fbcac65eb287d8d5791bddefd88.zip
git-4da504608ea94fbcac65eb287d8d5791bddefd88.tar.gz
git-4da504608ea94fbcac65eb287d8d5791bddefd88.tar.bz2
Fix remote.<remote>.vcs
remote.<remote>.vcs causes remote->foreign_vcs to be set on entry to transport_get(). Unfortunately, the code assumed that any such entry is stale from previous round. Fix this by making VCS set by URL to be volatile w.r.t. transport_get() instead. Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/transport.c b/transport.c
index 7714fdb..87581b8 100644
--- a/transport.c
+++ b/transport.c
@@ -912,20 +912,19 @@ static int external_specification_len(const char *url)
struct transport *transport_get(struct remote *remote, const char *url)
{
+ const char *helper;
struct transport *ret = xcalloc(1, sizeof(*ret));
if (!remote)
die("No remote provided to transport_get()");
ret->remote = remote;
+ helper = remote->foreign_vcs;
if (!url && remote && remote->url)
url = remote->url[0];
ret->url = url;
- /* In case previous URL had helper forced, reset it. */
- remote->foreign_vcs = NULL;
-
/* maybe it is a foreign URL? */
if (url) {
const char *p = url;
@@ -933,11 +932,11 @@ struct transport *transport_get(struct remote *remote, const char *url)
while (isalnum(*p))
p++;
if (!prefixcmp(p, "::"))
- remote->foreign_vcs = xstrndup(url, p - url);
+ helper = xstrndup(url, p - url);
}
- if (remote && remote->foreign_vcs) {
- transport_helper_init(ret, remote->foreign_vcs);
+ if (helper) {
+ transport_helper_init(ret, helper);
} else if (!prefixcmp(url, "rsync:")) {
ret->get_refs_list = get_refs_via_rsync;
ret->fetch = fetch_objs_via_rsync;