summaryrefslogtreecommitdiff
path: root/tests-clar/clone
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-01-03 02:13:37 +0100
committerVicent Marti <tanoku@gmail.com>2013-01-03 02:13:37 +0100
commitf46769e52a907ca3b11acf598c9837f37d82cea4 (patch)
tree80794f4b4f0862230e3f3c082bdb346a45586c2e /tests-clar/clone
parentafb181167ede0676b4a7bad5972cc712c3da1c17 (diff)
downloadlibgit2-f46769e52a907ca3b11acf598c9837f37d82cea4.tar.gz
Fix network suite
Diffstat (limited to 'tests-clar/clone')
-rw-r--r--tests-clar/clone/nonetwork.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/tests-clar/clone/nonetwork.c b/tests-clar/clone/nonetwork.c
index 623a0683f..91c020e9f 100644
--- a/tests-clar/clone/nonetwork.c
+++ b/tests-clar/clone/nonetwork.c
@@ -20,17 +20,13 @@ void test_clone_nonetwork__initialize(void)
void test_clone_nonetwork__cleanup(void)
{
- git_remote_free(g_origin);
-}
-
-static void cleanup_repository(void *path)
-{
if (g_repo) {
git_repository_free(g_repo);
g_repo = NULL;
}
- cl_fixture_cleanup((const char *)path);
+ cl_fixture_cleanup("./foo");
+ git_remote_free(g_origin);
}
void test_clone_nonetwork__bad_url(void)
@@ -48,7 +44,6 @@ void test_clone_nonetwork__bad_url(void)
void test_clone_nonetwork__local(void)
{
- cl_set_cleanup(&cleanup_repository, "./foo");
cl_git_pass(git_clone(&g_repo, g_origin, "./foo", &g_options));
}
@@ -56,32 +51,25 @@ void test_clone_nonetwork__local_absolute_path(void)
{
const char *local_src = cl_fixture("testrepo.git");
git_remote_free(g_origin);
- cl_git_pass(git_remote_new(&g_origin, NULL, "origin", local_src, GIT_REMOTE_DEFAULT_FETCH));
-
- cl_set_cleanup(&cleanup_repository, "./foo");
+ cl_git_pass(git_remote_new(&g_origin, NULL, "origin", local_src, GIT_REMOTE_DEFAULT_FETCH));
cl_git_pass(git_clone(&g_repo, g_origin, "./foo", &g_options));
}
void test_clone_nonetwork__local_bare(void)
{
- cl_set_cleanup(&cleanup_repository, "./foo");
g_options.bare = true;
cl_git_pass(git_clone(&g_repo, g_origin, "./foo", &g_options));
}
void test_clone_nonetwork__fail_when_the_target_is_a_file(void)
{
- cl_set_cleanup(&cleanup_repository, "./foo");
-
cl_git_mkfile("./foo", "Bar!");
cl_git_fail(git_clone(&g_repo, g_origin, "./foo", &g_options));
}
void test_clone_nonetwork__fail_with_already_existing_but_non_empty_directory(void)
{
- cl_set_cleanup(&cleanup_repository, "./foo");
-
p_mkdir("./foo", GIT_DIR_MODE);
cl_git_mkfile("./foo/bar", "Baz!");
cl_git_fail(git_clone(&g_repo, g_origin, "./foo", &g_options));