From 659cf2029f322ea876d663d85783b48945227e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Wed, 7 Jan 2015 12:23:05 +0000 Subject: 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. --- tests/clone/nonetwork.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'tests/clone/nonetwork.c') diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c index ac7c19212..f62966247 100644 --- a/tests/clone/nonetwork.c +++ b/tests/clone/nonetwork.c @@ -24,7 +24,6 @@ void test_clone_nonetwork__initialize(void) g_options.checkout_opts = dummy_opts; g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; g_options.remote_callbacks = dummy_callbacks; - cl_git_pass(git_signature_now(&g_options.signature, "Me", "foo@example.com")); } void test_clone_nonetwork__cleanup(void) @@ -44,7 +43,6 @@ void test_clone_nonetwork__cleanup(void) g_remote = NULL; } - git_signature_free(g_options.signature); cl_fixture_cleanup("./foo"); } @@ -228,13 +226,11 @@ void test_clone_nonetwork__can_detached_head(void) git_object *obj; git_repository *cloned; git_reference *cloned_head; - git_reflog *log; - const git_reflog_entry *entry; cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options)); cl_git_pass(git_revparse_single(&obj, g_repo, "master~1")); - cl_git_pass(git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL)); + cl_git_pass(git_repository_set_head_detached(g_repo, git_object_id(obj), NULL)); cl_git_pass(git_clone(&cloned, "./foo", "./foo1", &g_options)); @@ -243,13 +239,8 @@ void test_clone_nonetwork__can_detached_head(void) cl_git_pass(git_repository_head(&cloned_head, cloned)); cl_assert_equal_oid(git_object_id(obj), git_reference_target(cloned_head)); - cl_git_pass(git_reflog_read(&log, cloned, "HEAD")); - entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); - git_object_free(obj); git_reference_free(cloned_head); - git_reflog_free(log); git_repository_free(cloned); cl_fixture_cleanup("./foo1"); @@ -267,7 +258,6 @@ static void assert_correct_reflog(const char *name) cl_assert_equal_i(1, git_reflog_entrycount(log)); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s(expected_log_message, git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); git_reflog_free(log); } -- cgit v1.2.1