Commit 96a289f5 by Sascha Cunz

clone-empty-test: Don't use one pointer for two things

... so we can clean up correctly.
parent 3dc0207b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
static git_clone_options g_options; static git_clone_options g_options;
static git_remote *g_origin; static git_remote *g_origin;
static git_repository *g_repo; static git_repository *g_repo;
static git_repository *g_repo_cloned;
void test_clone_empty__initialize(void) void test_clone_empty__initialize(void)
{ {
...@@ -29,6 +30,9 @@ void test_clone_empty__cleanup(void) ...@@ -29,6 +30,9 @@ void test_clone_empty__cleanup(void)
static void cleanup_repository(void *path) static void cleanup_repository(void *path)
{ {
cl_fixture_cleanup((const char *)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) 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) ...@@ -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)); cl_git_pass(git_remote_new(&g_origin, NULL, "origin", "./empty_bare.git", GIT_REMOTE_DEFAULT_FETCH));
g_options.bare = true; 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) 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) ...@@ -51,7 +55,7 @@ void test_clone_empty__can_clone_an_empty_local_repo(void)
g_origin = NULL; g_origin = NULL;
cl_git_pass(git_remote_new(&g_origin, NULL, "origin", "./empty_bare.git", GIT_REMOTE_DEFAULT_FETCH)); 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) 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) ...@@ -66,5 +70,5 @@ void test_clone_empty__can_clone_an_empty_standard_repo(void)
cl_set_cleanup(&cleanup_repository, "./empty"); 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));
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment