Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-21 23:10:36 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 10:46:35 +0300
commit8f0104ecc54db00a075310ab744a19eb60e3d740 (patch)
tree775b3237a853c556a4d44840fc6c562e7b114415 /tests/clone
parent05259114427234831cf4915cbe40a5bb8ea021b0 (diff)
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.
Diffstat (limited to 'tests/clone')
-rw-r--r--tests/clone/empty.c4
-rw-r--r--tests/clone/nonetwork.c6
2 files changed, 5 insertions, 5 deletions
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(