summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorIlari Liusvaara <ilari.liusvaara@elisanet.fi>2009-12-09 17:26:33 +0200
committerJunio C Hamano <gitster@pobox.com>2009-12-28 00:24:15 -0800
commitb236752a8722c77b5a9b4ed488a992ee05252843 (patch)
tree4035f35d52c4e5a24c0dd3ddddcac76bcae6dc04 /transport-helper.c
parentfa8c097cc9b416283ae4c1c1507909ff207b7f60 (diff)
downloadgit-b236752a8722c77b5a9b4ed488a992ee05252843.tar.gz
Support remote archive from all smart transports
Previously, remote archive required internal (non remote-helper) smart transport. Extend the remote archive to also support smart transports implemented by remote helpers. Signed-off-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport-helper.c')
-rw-r--r--transport-helper.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c
index 50b3bac0c4..6ece0d9875 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -467,6 +467,24 @@ static int process_connect(struct transport *transport,
return process_connect_service(transport, name, exec);
}
+static int connect_helper(struct transport *transport, const char *name,
+ const char *exec, int fd[2])
+{
+ struct helper_data *data = transport->data;
+
+ /* Get_helper so connect is inited. */
+ get_helper(transport);
+ if (!data->connect)
+ die("Operation not supported by protocol.");
+
+ if (!process_connect_service(transport, name, exec))
+ die("Can't connect to subservice %s.", name);
+
+ fd[0] = data->helper->out;
+ fd[1] = data->helper->in;
+ return 0;
+}
+
static int fetch(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
@@ -711,6 +729,7 @@ int transport_helper_init(struct transport *transport, const char *name)
transport->fetch = fetch;
transport->push_refs = push_refs;
transport->disconnect = release_helper;
+ transport->connect = connect_helper;
transport->smart_options = &(data->transport_options);
return 0;
}