diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-01-07 12:23:05 +0000 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-03-03 14:40:50 +0100 |
| commit | 659cf2029f322ea876d663d85783b48945227e8f (patch) | |
| tree | 435e9185c38d96656e21db83fc736b5294499b10 /tests/online | |
| parent | 99b68a2aecfaa24f252f265d61b230b8e2576dd2 (diff) | |
| download | libgit2-659cf2029f322ea876d663d85783b48945227e8f.tar.gz | |
Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.
In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
Diffstat (limited to 'tests/online')
| -rw-r--r-- | tests/online/fetch.c | 8 | ||||
| -rw-r--r-- | tests/online/fetchhead.c | 2 | ||||
| -rw-r--r-- | tests/online/push.c | 9 |
3 files changed, 8 insertions, 11 deletions
diff --git a/tests/online/fetch.c b/tests/online/fetch.c index 848b87410..fcbe24d5f 100644 --- a/tests/online/fetch.c +++ b/tests/online/fetch.c @@ -48,7 +48,7 @@ static void do_fetch(const char *url, git_remote_autotag_option_t flag, int n) git_remote_set_autotag(remote, flag); cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); cl_git_pass(git_remote_download(remote, NULL)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); + cl_git_pass(git_remote_update_tips(remote, NULL)); git_remote_disconnect(remote); cl_assert_equal_i(counter, n); cl_assert(bytes_received > 0); @@ -132,7 +132,7 @@ 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_update_tips(remote, NULL, NULL)); + cl_git_pass(git_remote_update_tips(remote, NULL)); git_remote_disconnect(remote); git_remote_free(remote); @@ -208,8 +208,8 @@ void test_online_fetch__twice(void) git_remote *remote; cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(remote, NULL, NULL)); + cl_git_pass(git_remote_fetch(remote, NULL, NULL)); git_remote_free(remote); } diff --git a/tests/online/fetchhead.c b/tests/online/fetchhead.c index b0a80cd58..9a97abef3 100644 --- a/tests/online/fetchhead.c +++ b/tests/online/fetchhead.c @@ -53,7 +53,7 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet 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, NULL)); + cl_git_pass(git_remote_update_tips(remote, NULL)); git_remote_disconnect(remote); git_remote_free(remote); diff --git a/tests/online/push.c b/tests/online/push.c index 1e30a1035..b0ef250fc 100644 --- a/tests/online/push.c +++ b/tests/online/push.c @@ -322,6 +322,7 @@ void test_online_push__initialize(void) _repo = cl_git_sandbox_init("push_src"); + cl_git_pass(git_repository_set_ident(_repo, "Random J. Hacker", "foo@example.com")); cl_fixture_sandbox("testrepo.git"); cl_rename("push_src/submodule/.gitted", "push_src/submodule/.git"); @@ -395,7 +396,7 @@ void test_online_push__initialize(void) /* Now that we've deleted everything, fetch from the remote */ cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_FETCH)); cl_git_pass(git_remote_download(_remote, NULL)); - cl_git_pass(git_remote_update_tips(_remote, NULL, NULL)); + cl_git_pass(git_remote_update_tips(_remote, NULL)); git_remote_disconnect(_remote); } @@ -458,7 +459,6 @@ static void do_push( size_t i; int error; git_strarray specs = {0}; - git_signature *pusher; git_remote_callbacks callbacks; record_callbacks_data *data; @@ -466,8 +466,6 @@ static void do_push( /* Auto-detect the number of threads to use */ opts.pb_parallelism = 0; - cl_git_pass(git_signature_now(&pusher, "Foo Bar", "foo@example.com")); - memcpy(&callbacks, git_remote_get_callbacks(_remote), sizeof(callbacks)); data = callbacks.payload; @@ -489,7 +487,7 @@ static void do_push( if (check_progress_cb && expected_ret == GIT_EUSER) data->transfer_progress_calls = GIT_EUSER; - error = git_remote_push(_remote, &specs, &opts, pusher, "test push"); + error = git_remote_push(_remote, &specs, &opts, "test push"); git__free(specs.strings); if (expected_ret < 0) { @@ -511,7 +509,6 @@ static void do_push( if (check_update_tips_cb) verify_update_tips_callback(_remote, expected_refs, expected_refs_len); - git_signature_free(pusher); } } |
