diff options
author | Ilari Liusvaara <ilari.liusvaara@elisanet.fi> | 2009-12-09 17:26:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-28 00:24:15 -0800 |
commit | b236752a8722c77b5a9b4ed488a992ee05252843 (patch) | |
tree | 4035f35d52c4e5a24c0dd3ddddcac76bcae6dc04 /transport.c | |
parent | fa8c097cc9b416283ae4c1c1507909ff207b7f60 (diff) | |
download | git-b236752a8722c77b5a9b4ed488a992ee05252843.tar.gz git-b236752a8722c77b5a9b4ed488a992ee05252843.tar.xz |
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.c')
-rw-r--r-- | transport.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/transport.c b/transport.c index ad25b98ae..a7d67eba8 100644 --- a/transport.c +++ b/transport.c @@ -756,6 +756,17 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re return ret; } +static int connect_git(struct transport *transport, const char *name, + const char *executable, int fd[2]) +{ + struct git_transport_data *data = transport->data; + data->conn = git_connect(data->fd, transport->url, + executable, 0); + fd[0] = data->fd[0]; + fd[1] = data->fd[1]; + return 0; +} + static int disconnect_git(struct transport *transport) { struct git_transport_data *data = transport->data; @@ -901,6 +912,7 @@ struct transport *transport_get(struct remote *remote, const char *url) ret->get_refs_list = get_refs_via_connect; ret->fetch = fetch_refs_via_pack; ret->push_refs = git_transport_push; + ret->connect = connect_git; ret->disconnect = disconnect_git; ret->smart_options = &(data->options); @@ -1061,6 +1073,15 @@ void transport_unlock_pack(struct transport *transport) } } +int transport_connect(struct transport *transport, const char *name, + const char *exec, int fd[2]) +{ + if (transport->connect) + return transport->connect(transport, name, exec, fd); + else + die("Operation not supported by protocol"); +} + int transport_disconnect(struct transport *transport) { int ret = 0; |