summaryrefslogtreecommitdiff
path: root/tests/online/fetchhead.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-21 22:10:36 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 09:46:35 +0200
commit8f0104ecc54db00a075310ab744a19eb60e3d740 (patch)
tree775b3237a853c556a4d44840fc6c562e7b114415 /tests/online/fetchhead.c
parent05259114427234831cf4915cbe40a5bb8ea021b0 (diff)
downloadlibgit2-8f0104ecc54db00a075310ab744a19eb60e3d740.tar.gz
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/online/fetchhead.c')
-rw-r--r--tests/online/fetchhead.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/online/fetchhead.c b/tests/online/fetchhead.c
index 9a97abef3..b24b1b511 100644
--- a/tests/online/fetchhead.c
+++ b/tests/online/fetchhead.c
@@ -12,12 +12,12 @@ static git_clone_options g_options;
void test_online_fetchhead__initialize(void)
{
- git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT;
+ git_fetch_options dummy_fetch = GIT_FETCH_OPTIONS_INIT;
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_fetch;
}
void test_online_fetchhead__cleanup(void)
@@ -51,10 +51,7 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet
active_refs = &array;
}
- cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH));
- cl_git_pass(git_remote_download(remote, active_refs));
- cl_git_pass(git_remote_update_tips(remote, NULL));
- git_remote_disconnect(remote);
+ cl_git_pass(git_remote_fetch(remote, active_refs, NULL, NULL));
git_remote_free(remote);
cl_git_pass(git_futils_readbuffer(&fetchhead_buf, "./foo/.git/FETCH_HEAD"));