summaryrefslogtreecommitdiff
path: root/tests-clar/network
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-08-14 11:18:05 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-08-14 11:52:49 +0200
commit0b9ebb54ff9aab86bb858e1d2952efa4dcdafefa (patch)
tree43abda1362b751f1889ea213cf3fff3e5f307f70 /tests-clar/network
parent2af9bcb2dbb47adafa7eecbf41ff113da7fa9d1b (diff)
downloadlibgit2-0b9ebb54ff9aab86bb858e1d2952efa4dcdafefa.tar.gz
remote: relax the url rules
Accept any value for the remote's url, including an empty string which we used to reject as invalid configuration. This is not quite what git does (although it has its own problems with such configurations) and it makes it harder to fix the issue, by not letting the user modify it. As we already need to check for a valid URL when we try to connect to the network, let that perform the check, as we don't need to do it anywhere else.
Diffstat (limited to 'tests-clar/network')
-rw-r--r--tests-clar/network/remote/remotes.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests-clar/network/remote/remotes.c b/tests-clar/network/remote/remotes.c
index 3c4fa96fa..dec646526 100644
--- a/tests-clar/network/remote/remotes.c
+++ b/tests-clar/network/remote/remotes.c
@@ -361,13 +361,15 @@ void test_network_remote_remotes__tagopt(void)
git_config_free(cfg);
}
-void test_network_remote_remotes__cannot_load_with_an_empty_url(void)
+void test_network_remote_remotes__can_load_with_an_empty_url(void)
{
git_remote *remote = NULL;
- cl_git_fail(git_remote_load(&remote, _repo, "empty-remote-url"));
- cl_assert(giterr_last()->klass == GITERR_INVALID);
- cl_assert_equal_p(remote, NULL);
+ cl_git_pass(git_remote_load(&remote, _repo, "empty-remote-url"));
+
+ cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH));
+
+ git_remote_free(remote);
}
void test_network_remote_remotes__check_structure_version(void)