summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-10-30 18:54:39 -0700
committerBen Straub <bs@github.com>2013-10-30 18:54:39 -0700
commitff0ef88c5bb570ea2553ba6ea99236a68d39f950 (patch)
tree5d5e04025560b5bf14332cf27bf4077c40f013ff
parent29b77446b7237204ddd7fee36c0ad3b4c9513715 (diff)
downloadlibgit2-ff0ef88c5bb570ea2553ba6ea99236a68d39f950.tar.gz
Test more kinds of bad url
-rw-r--r--tests-clar/clone/nonetwork.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests-clar/clone/nonetwork.c b/tests-clar/clone/nonetwork.c
index 071e3d09f..9eb4bf9db 100644
--- a/tests-clar/clone/nonetwork.c
+++ b/tests-clar/clone/nonetwork.c
@@ -46,7 +46,7 @@ void test_clone_nonetwork__cleanup(void)
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 */
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
@@ -54,6 +54,15 @@ void test_clone_nonetwork__bad_url(void)
g_options.bare = true;
cl_git_fail(git_clone(&g_repo, "not_a_repo", "./foo", &g_options));
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)