diff options
author | Ben Straub <bs@github.com> | 2013-10-03 06:20:20 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-10-03 06:20:20 -0700 |
commit | fc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc (patch) | |
tree | 1446cb018eb05571b4eff101ceae937688e83a1d /tests-clar/online/fetch.c | |
parent | de8fe729efd350ae5cb1ef25ffb08f92c6f706b9 (diff) | |
parent | ab1368766240cfe861729642abe1cddd01c0203e (diff) | |
download | libgit2-fc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc.tar.gz |
Merge branch 'development' into blame
Conflicts:
include/git2.h
Diffstat (limited to 'tests-clar/online/fetch.c')
-rw-r--r-- | tests-clar/online/fetch.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests-clar/online/fetch.c b/tests-clar/online/fetch.c index f76c6cff9..df1b2e288 100644 --- a/tests-clar/online/fetch.c +++ b/tests-clar/online/fetch.c @@ -38,14 +38,16 @@ static void do_fetch(const char *url, git_remote_autotag_option_t flag, int n) git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; size_t bytes_received = 0; + callbacks.transfer_progress = progress; callbacks.update_tips = update_tips; + callbacks.payload = &bytes_received; counter = 0; cl_git_pass(git_remote_create(&remote, _repo, "test", url)); git_remote_set_callbacks(remote, &callbacks); git_remote_set_autotag(remote, flag); cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(remote, progress, &bytes_received)); + cl_git_pass(git_remote_download(remote)); cl_git_pass(git_remote_update_tips(remote)); git_remote_disconnect(remote); cl_assert_equal_i(counter, n); @@ -93,6 +95,7 @@ void test_online_fetch__doesnt_retrieve_a_pack_when_the_repository_is_up_to_date git_repository *_repository; bool invoked = false; git_remote *remote; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; git_clone_options opts = GIT_CLONE_OPTIONS_INIT; opts.bare = true; @@ -107,7 +110,10 @@ void test_online_fetch__doesnt_retrieve_a_pack_when_the_repository_is_up_to_date cl_assert_equal_i(false, invoked); - cl_git_pass(git_remote_download(remote, &transferProgressCallback, &invoked)); + callbacks.transfer_progress = &transferProgressCallback; + callbacks.payload = &invoked; + git_remote_set_callbacks(remote, &callbacks); + cl_git_pass(git_remote_download(remote)); cl_assert_equal_i(false, invoked); @@ -131,11 +137,17 @@ void test_online_fetch__can_cancel(void) { git_remote *remote; size_t bytes_received = 0; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); + + callbacks.transfer_progress = cancel_at_half; + callbacks.payload = &bytes_received; + git_remote_set_callbacks(remote, &callbacks); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_fail_with(git_remote_download(remote, cancel_at_half, &bytes_received), GIT_EUSER); + cl_git_fail_with(git_remote_download(remote), GIT_EUSER); git_remote_disconnect(remote); git_remote_free(remote); } |