summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-01-12 12:55:40 +0000
committerPatrick Steinhardt <ps@pks.im>2018-01-12 13:10:47 +0000
commit093e671ee8fb824e3e40677ed7440dba72483fe1 (patch)
tree89d922176e07eb8ad4fa6b105a9ca373f0108f31
parentf1323d9c161aeeada190fd9615a8b5a9fb8a7f3e (diff)
downloadlibgit2-093e671ee8fb824e3e40677ed7440dba72483fe1.tar.gz
tests: network::fetchlocal: let cleanup function handle sandbox cleanup
Two tests in network::fetchlocal explicitly set a cleanup function to free and remove the created sandbox repositories. This is not necessary, though, as the cleanup function executed after each test already takes care of cleaning up after them. Remove the code to avoid needless code duplication.
-rw-r--r--tests/network/fetchlocal.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/tests/network/fetchlocal.c b/tests/network/fetchlocal.c
index 17c8f26e3..91e2a0595 100644
--- a/tests/network/fetchlocal.c
+++ b/tests/network/fetchlocal.c
@@ -314,12 +314,6 @@ void test_network_fetchlocal__prune_tag(void)
git_repository_free(repo);
}
-static void cleanup_sandbox(void *unused)
-{
- GIT_UNUSED(unused);
- cl_git_sandbox_cleanup();
-}
-
void test_network_fetchlocal__partial(void)
{
git_repository *repo = cl_git_sandbox_init("partial-testrepo");
@@ -332,7 +326,6 @@ void test_network_fetchlocal__partial(void)
options.callbacks.transfer_progress = transfer_cb;
options.callbacks.payload = &callcount;
- cl_set_cleanup(&cleanup_sandbox, NULL);
cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(1, (int)refnames.count);
@@ -420,7 +413,6 @@ void test_network_fetchlocal__multi_remotes(void)
git_strarray refnames = {0};
git_fetch_options options = GIT_FETCH_OPTIONS_INIT;
- cl_set_cleanup(&cleanup_sandbox, NULL);
options.callbacks.transfer_progress = transfer_cb;
cl_git_pass(git_remote_set_url(repo, "test", cl_git_fixture_url("testrepo.git")));
cl_git_pass(git_remote_lookup(&test, repo, "test"));