From 96a289f5f3d2ceeb84ac50216c44107583b48b8d Mon Sep 17 00:00:00 2001 From: Sascha Cunz Date: Wed, 19 Dec 2012 05:24:23 +0100 Subject: [PATCH] clone-empty-test: Don't use one pointer for two things ... so we can clean up correctly. --- tests-clar/clone/empty.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests-clar/clone/empty.c b/tests-clar/clone/empty.c index 0f0edcb8d..8f2e6ff12 100644 --- a/tests-clar/clone/empty.c +++ b/tests-clar/clone/empty.c @@ -6,6 +6,7 @@ static git_clone_options g_options; static git_remote *g_origin; static git_repository *g_repo; +static git_repository *g_repo_cloned; void test_clone_empty__initialize(void) { @@ -29,6 +30,9 @@ void test_clone_empty__cleanup(void) static void cleanup_repository(void *path) { cl_fixture_cleanup((const char *)path); + + git_repository_free(g_repo_cloned); + g_repo_cloned = NULL; } void test_clone_empty__can_clone_an_empty_local_repo_barely(void) @@ -40,7 +44,7 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void) cl_git_pass(git_remote_new(&g_origin, NULL, "origin", "./empty_bare.git", GIT_REMOTE_DEFAULT_FETCH)); g_options.bare = true; - cl_git_pass(git_clone(&g_repo, g_origin, "./empty", &g_options)); + cl_git_pass(git_clone(&g_repo_cloned, g_origin, "./empty", &g_options)); } void test_clone_empty__can_clone_an_empty_local_repo(void) @@ -51,7 +55,7 @@ void test_clone_empty__can_clone_an_empty_local_repo(void) g_origin = NULL; cl_git_pass(git_remote_new(&g_origin, NULL, "origin", "./empty_bare.git", GIT_REMOTE_DEFAULT_FETCH)); - cl_git_pass(git_clone(&g_repo, g_origin, "./empty", &g_options)); + cl_git_pass(git_clone(&g_repo_cloned, g_origin, "./empty", &g_options)); } void test_clone_empty__can_clone_an_empty_standard_repo(void) @@ -66,5 +70,5 @@ void test_clone_empty__can_clone_an_empty_standard_repo(void) cl_set_cleanup(&cleanup_repository, "./empty"); - cl_git_pass(git_clone(&g_repo, g_origin, "./empty", &g_options)); + cl_git_pass(git_clone(&g_repo_cloned, g_origin, "./empty", &g_options)); }