mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 22:23:05 +00:00
Move some clone tests to the nonetwork suite
This commit is contained in:
parent
cd5ca5b97f
commit
922dd9788c
@ -61,14 +61,6 @@ void test_clone_network__network_bare(void)
|
|||||||
git_remote_free(origin);
|
git_remote_free(origin);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_clone_network__cope_with_already_existing_directory(void)
|
|
||||||
{
|
|
||||||
cl_set_cleanup(&cleanup_repository, "./foo");
|
|
||||||
|
|
||||||
p_mkdir("./foo", GIT_DIR_MODE);
|
|
||||||
cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options));
|
|
||||||
}
|
|
||||||
|
|
||||||
void test_clone_network__empty_repository(void)
|
void test_clone_network__empty_repository(void)
|
||||||
{
|
{
|
||||||
git_reference *head;
|
git_reference *head;
|
||||||
@ -87,20 +79,6 @@ void test_clone_network__empty_repository(void)
|
|||||||
git_reference_free(head);
|
git_reference_free(head);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_clone_network__can_prevent_the_checkout_of_a_standard_repo(void)
|
|
||||||
{
|
|
||||||
git_buf path = GIT_BUF_INIT;
|
|
||||||
cl_set_cleanup(&cleanup_repository, "./foo");
|
|
||||||
|
|
||||||
g_options.checkout_opts.checkout_strategy = 0;
|
|
||||||
cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options));
|
|
||||||
|
|
||||||
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "master.txt"));
|
|
||||||
cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&path)));
|
|
||||||
|
|
||||||
git_buf_free(&path);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void checkout_progress(const char *path, size_t cur, size_t tot, void *payload)
|
static void checkout_progress(const char *path, size_t cur, size_t tot, void *payload)
|
||||||
{
|
{
|
||||||
bool *was_called = (bool*)payload;
|
bool *was_called = (bool*)payload;
|
||||||
|
@ -160,3 +160,25 @@ void test_clone_nonetwork__custom_autotag(void)
|
|||||||
cl_assert_equal_i(0, tags.count);
|
cl_assert_equal_i(0, tags.count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_clone_nonetwork__cope_with_already_existing_directory(void)
|
||||||
|
{
|
||||||
|
cl_set_cleanup(&cleanup_repository, "./foo");
|
||||||
|
|
||||||
|
p_mkdir("./foo", GIT_DIR_MODE);
|
||||||
|
cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options));
|
||||||
|
}
|
||||||
|
|
||||||
|
void test_clone_nonetwork__can_prevent_the_checkout_of_a_standard_repo(void)
|
||||||
|
{
|
||||||
|
git_buf path = GIT_BUF_INIT;
|
||||||
|
cl_set_cleanup(&cleanup_repository, "./foo");
|
||||||
|
|
||||||
|
g_options.checkout_opts.checkout_strategy = 0;
|
||||||
|
cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options));
|
||||||
|
|
||||||
|
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "master.txt"));
|
||||||
|
cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&path)));
|
||||||
|
|
||||||
|
git_buf_free(&path);
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user