Commit ff0ef88c by Ben Straub

Test more kinds of bad url

parent 29b77446
...@@ -46,7 +46,7 @@ void test_clone_nonetwork__cleanup(void) ...@@ -46,7 +46,7 @@ void test_clone_nonetwork__cleanup(void)
cl_fixture_cleanup("./foo"); cl_fixture_cleanup("./foo");
} }
void test_clone_nonetwork__bad_url(void) void test_clone_nonetwork__bad_urls(void)
{ {
/* Clone should clean up the mess if the URL isn't a git repository */ /* Clone should clean up the mess if the URL isn't a git repository */
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options)); cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
...@@ -54,6 +54,15 @@ void test_clone_nonetwork__bad_url(void) ...@@ -54,6 +54,15 @@ void test_clone_nonetwork__bad_url(void)
g_options.bare = true; g_options.bare = true;
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options)); cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
cl_assert(!git_path_exists("./foo")); cl_assert(!git_path_exists("./foo"));
cl_git_fail(git_clone(&g_repo, "git://example.com:asdf", "./foo", &g_options));
cl_assert(!git_path_exists("./foo"));
cl_git_fail(git_clone(&g_repo, "git://example.com:asdf/foo", "./foo", &g_options));
cl_assert(!git_path_exists("./foo"));
cl_git_fail(git_clone(&g_repo, "https://example.com:asdf", "./foo", &g_options));
cl_assert(!git_path_exists("./foo"));
cl_git_fail(git_clone(&g_repo, "https://example.com:asdf/foo", "./foo", &g_options));
cl_assert(!git_path_exists("./foo"));
} }
void test_clone_nonetwork__do_not_clean_existing_directory(void) void test_clone_nonetwork__do_not_clean_existing_directory(void)
......
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