Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/clone/nonetwork.c')
-rw-r--r--tests-clar/clone/nonetwork.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/tests-clar/clone/nonetwork.c b/tests-clar/clone/nonetwork.c
index 4bcb5be1e..071e3d09f 100644
--- a/tests-clar/clone/nonetwork.c
+++ b/tests-clar/clone/nonetwork.c
@@ -56,41 +56,18 @@ void test_clone_nonetwork__bad_url(void)
cl_assert(!git_path_exists("./foo"));
}
-static int dont_call_me(void *state, git_buf *path)
-{
- GIT_UNUSED(state);
- GIT_UNUSED(path);
- return GIT_ERROR;
-}
-
void test_clone_nonetwork__do_not_clean_existing_directory(void)
{
- git_buf path_buf = GIT_BUF_INIT;
-
- git_buf_put(&path_buf, "./foo", 5);
-
/* Clone should not remove the directory if it already exists, but
* Should clean up entries it creates. */
p_mkdir("./foo", GIT_DIR_MODE);
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
- cl_assert(git_path_exists("./foo"));
-
- /* Make sure the directory is empty. */
- cl_git_pass(git_path_direach(&path_buf,
- dont_call_me,
- NULL));
+ cl_assert(git_path_is_empty_dir("./foo"));
/* Try again with a bare repository. */
g_options.bare = true;
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
- cl_assert(git_path_exists("./foo"));
-
- /* Make sure the directory is empty. */
- cl_git_pass(git_path_direach(&path_buf,
- dont_call_me,
- NULL));
-
- git_buf_free(&path_buf);
+ cl_assert(git_path_is_empty_dir("./foo"));
}
void test_clone_nonetwork__local(void)