diff options
author | Ben Straub <bs@github.com> | 2014-01-29 22:35:46 +0400 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2014-01-31 03:53:52 +0400 |
commit | a1710a28f684298f79a0bab08b0b8930c1d57cf0 (patch) | |
tree | 6393f7683112593c502bbd8f6b4612fd213fca6c /tests/clone | |
parent | a1b07dca7d456b5eb1f32e6f25c4f419752778b3 (diff) |
Enhance testing of signature parameters
Diffstat (limited to 'tests/clone')
-rw-r--r-- | tests/clone/nonetwork.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c index 14d2bbf59..f00d28b7a 100644 --- a/tests/clone/nonetwork.c +++ b/tests/clone/nonetwork.c @@ -24,6 +24,7 @@ void test_clone_nonetwork__initialize(void) g_options.checkout_opts = dummy_opts; g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; 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) @@ -43,6 +44,7 @@ void test_clone_nonetwork__cleanup(void) g_remote = NULL; } + git_signature_free(g_options.signature); cl_fixture_cleanup("./foo"); } @@ -213,6 +215,8 @@ 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)); @@ -226,8 +230,13 @@ void test_clone_nonetwork__can_detached_head(void) cl_git_pass(git_repository_head(&cloned_head, cloned)); cl_assert(!git_oid_cmp(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"); @@ -252,12 +261,9 @@ static void assert_correct_reflog(const char *name) void test_clone_nonetwork__clone_updates_reflog_properly(void) { - cl_git_pass(git_signature_now(&g_options.signature, "Me", "foo@example.com")); cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options)); assert_correct_reflog("HEAD"); assert_correct_reflog("refs/heads/master"); - - git_signature_free(g_options.signature); } void test_clone_nonetwork__clone_into_updates_reflog_properly(void) @@ -274,5 +280,5 @@ void test_clone_nonetwork__clone_into_updates_reflog_properly(void) assert_correct_reflog("refs/heads/master"); git_remote_free(remote); - git_signature_free(g_options.signature); + git_signature_free(sig); } |