summaryrefslogtreecommitdiff
path: root/tests/clone
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-22 15:45:21 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 09:46:36 +0200
commit058b753ceb8f6b25b77e57106b3a87997bc6362a (patch)
tree2ad699eda443d924a51d18aaa61c22e10f7eba31 /tests/clone
parent6fb373a0e8eeff3c94853ff0ac55ca6b561c44a1 (diff)
downloadlibgit2-058b753ceb8f6b25b77e57106b3a87997bc6362a.tar.gz
remote: move the transport ctor to the callbacks
Instead of having it set in a different place from every other callback, put it the main structure. This removes some state from the remote and makes it behave more like clone, where the constructors are passed via the options.
Diffstat (limited to 'tests/clone')
-rw-r--r--tests/clone/transport.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/clone/transport.c b/tests/clone/transport.c
index 46c16a241..cccaae219 100644
--- a/tests/clone/transport.c
+++ b/tests/clone/transport.c
@@ -24,10 +24,9 @@ static int custom_transport_remote_create(
{
int error;
- if ((error = git_remote_create(out, repo, name, url)) < 0)
- return error;
+ GIT_UNUSED(payload);
- if ((error = git_remote_set_transport(*out, custom_transport, payload)) < 0)
+ if ((error = git_remote_create(out, repo, name, url)) < 0)
return error;
return 0;
@@ -40,7 +39,8 @@ void test_clone_transport__custom_transport(void)
int custom_transport_used = 0;
clone_opts.remote_cb = custom_transport_remote_create;
- clone_opts.remote_cb_payload = &custom_transport_used;
+ clone_opts.fetch_opts.callbacks.transport = custom_transport;
+ clone_opts.fetch_opts.callbacks.payload = &custom_transport_used;
cl_git_pass(git_clone(&repo, cl_fixture("testrepo.git"), "./custom_transport.git", &clone_opts));
git_repository_free(repo);