Skip to content

Commit 093e671

Browse files
committed
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.
1 parent f1323d9 commit 093e671

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

tests/network/fetchlocal.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,6 @@ void test_network_fetchlocal__prune_tag(void)
314314
git_repository_free(repo);
315315
}
316316

317-
static void cleanup_sandbox(void *unused)
318-
{
319-
GIT_UNUSED(unused);
320-
cl_git_sandbox_cleanup();
321-
}
322-
323317
void test_network_fetchlocal__partial(void)
324318
{
325319
git_repository *repo = cl_git_sandbox_init("partial-testrepo");
@@ -332,7 +326,6 @@ void test_network_fetchlocal__partial(void)
332326
options.callbacks.transfer_progress = transfer_cb;
333327
options.callbacks.payload = &callcount;
334328

335-
cl_set_cleanup(&cleanup_sandbox, NULL);
336329
cl_git_pass(git_reference_list(&refnames, repo));
337330
cl_assert_equal_i(1, (int)refnames.count);
338331

@@ -420,7 +413,6 @@ void test_network_fetchlocal__multi_remotes(void)
420413
git_strarray refnames = {0};
421414
git_fetch_options options = GIT_FETCH_OPTIONS_INIT;
422415

423-
cl_set_cleanup(&cleanup_sandbox, NULL);
424416
options.callbacks.transfer_progress = transfer_cb;
425417
cl_git_pass(git_remote_set_url(repo, "test", cl_git_fixture_url("testrepo.git")));
426418
cl_git_pass(git_remote_lookup(&test, repo, "test"));

0 commit comments

Comments
 (0)