*/
GIT_EXTERN(int) git_transport_new(git_transport **transport, const char *url);
-GIT_EXTERN(int) git_transport_connect(git_transport *transport, int direction);
-
-GIT_EXTERN(int) git_transport_ls(git_transport *transport, git_headarray *array);
-GIT_EXTERN(int) git_transport_close(git_transport *transport);
-GIT_EXTERN(void) git_transport_free(git_transport *transport);
-
-GIT_EXTERN(int) git_transport_add(git_transport *transport, const char *prefix);
-
/** @} */
GIT_END_DECL
#endif
if (error < GIT_SUCCESS)
return error;
- error = git_transport_ls(t, &refs);
+ error = t->ls(t, &refs);
if (error < GIT_SUCCESS) {
error = git__rethrow(error, "Failed to get remote ref list");
goto cleanup;
{
int error;
git_headarray *list = &remote->refs;
+ git_transport *t = remote->transport;
error = filter_wants(remote);
if (error < GIT_SUCCESS)
* Now we have everything set up so we can start tell the server
* what we want and what we have.
*/
- error = git_transport_send_wants(remote->transport, list);
+ error = t->send_wants(t, list);
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to send want list");
- return git_transport_negotiate_fetch(remote->transport, remote->repo, &remote->refs);
+ return t->negotiate_fetch(t, remote->repo, &remote->refs);
}
int git_fetch_download_pack(char **out, git_remote *remote)
return GIT_SUCCESS;
}
- return git_transport_download_pack(out, remote->transport, remote->repo);
+ return remote->transport->download_pack(out, remote->transport, remote->repo);
}
if (error < GIT_SUCCESS)
return git__rethrow(error, "Failed to create transport");
- error = git_transport_connect(t, direction);
+ error = t->connect(t, direction);
if (error < GIT_SUCCESS) {
error = git__rethrow(error, "Failed to connect the transport");
goto cleanup;
cleanup:
if (error < GIT_SUCCESS)
- git_transport_free(t);
+ t->free(t);
return error;
}
int git_remote_ls(git_remote *remote, git_headarray *refs)
{
- return git_transport_ls(remote->transport, refs);
+ return remote->transport->ls(remote->transport, refs);
}
int git_remote_negotiate(git_remote *remote)
free(remote->name);
if (remote->transport != NULL) {
if (remote->transport->connected)
- git_transport_close(remote->transport);
- git_transport_free(remote->transport);
+ remote->transport->close(remote->transport);
+
+ remote->transport->free(remote->transport);
}
free(remote);
}
return GIT_SUCCESS;
}
-
-int git_transport_connect(git_transport *transport, int direction)
-{
- return transport->connect(transport, direction);
-}
-
-int git_transport_ls(git_transport *transport, git_headarray *array)
-{
- return transport->ls(transport, array);
-}
-
-int git_transport_send_wants(struct git_transport *transport, git_headarray *array)
-{
- return transport->send_wants(transport, array);
-}
-
-int git_transport_send_have(struct git_transport *transport, git_oid *oid)
-{
- return transport->send_have(transport, oid);
-}
-
-int git_transport_negotiate_fetch(struct git_transport *transport, git_repository *repo, git_headarray *list)
-{
- return transport->negotiate_fetch(transport, repo, list);
-}
-
-int git_transport_send_flush(struct git_transport *transport)
-{
- return transport->send_flush(transport);
-}
-
-int git_transport_send_done(struct git_transport *transport)
-{
- return transport->send_done(transport);
-}
-
-int git_transport_download_pack(char **out, git_transport *transport, git_repository *repo)
-{
- return transport->download_pack(out, transport, repo);
-}
-
-int git_transport_close(git_transport *transport)
-{
- return transport->close(transport);
-}
-
-void git_transport_free(git_transport *transport)
-{
- transport->free(transport);
-}
int git_transport_git(struct git_transport **transport);
int git_transport_dummy(struct git_transport **transport);
-int git_transport_send_wants(struct git_transport *transport, git_headarray *array);
-int git_transport_negotiate_fetch(struct git_transport *transport, git_repository *repo, git_headarray *array);
-int git_transport_send_have(struct git_transport *transport, git_oid *oid);
-int git_transport_send_done(struct git_transport *transport);
-int git_transport_send_flush(struct git_transport *transport);
-int git_transport_download_pack(char **out, git_transport *transport, git_repository *repo);
-
#endif