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/push.c | |
| 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/push.c')
| -rw-r--r-- | tests/online/push.c | 9 |
1 files changed, 3 insertions, 6 deletions
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); } } |
