From 8f0104ecc54db00a075310ab744a19eb60e3d740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 21 Apr 2015 22:10:36 +0200 Subject: Remove the callbacks struct from the remote Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference. --- tests/clone/empty.c | 4 ++-- tests/clone/nonetwork.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/clone') diff --git a/tests/clone/empty.c b/tests/clone/empty.c index 8f6071096..2a6217580 100644 --- a/tests/clone/empty.c +++ b/tests/clone/empty.c @@ -10,14 +10,14 @@ static git_repository *g_repo_cloned; void test_clone_empty__initialize(void) { git_repository *sandbox = cl_git_sandbox_init("empty_bare.git"); - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_options = GIT_FETCH_OPTIONS_INIT; cl_git_remove_placeholders(git_repository_path(sandbox), "dummy-marker.txt"); g_repo = NULL; memset(&g_options, 0, sizeof(git_clone_options)); g_options.version = GIT_CLONE_OPTIONS_VERSION; - g_options.remote_callbacks = dummy_callbacks; + g_options.fetch_opts = dummy_options; } void test_clone_empty__cleanup(void) diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c index e4794fc14..fec6aff2e 100644 --- a/tests/clone/nonetwork.c +++ b/tests/clone/nonetwork.c @@ -15,7 +15,7 @@ static git_remote* g_remote; void test_clone_nonetwork__initialize(void) { git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_fetch = GIT_FETCH_OPTIONS_INIT; g_repo = NULL; @@ -23,7 +23,7 @@ void test_clone_nonetwork__initialize(void) g_options.version = GIT_CLONE_OPTIONS_VERSION; g_options.checkout_opts = dummy_opts; g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - g_options.remote_callbacks = dummy_callbacks; + g_options.fetch_opts = dummy_fetch; } void test_clone_nonetwork__cleanup(void) @@ -179,7 +179,7 @@ void test_clone_nonetwork__can_cancel_clone_in_fetch(void) { g_options.checkout_branch = "test"; - g_options.remote_callbacks.transfer_progress = + g_options.fetch_opts.callbacks.transfer_progress = clone_cancel_fetch_transfer_progress_cb; cl_git_fail_with(git_clone( -- cgit v1.2.3