summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-11-05 07:49:37 +0100
committerJustin Spahr-Summers <Justin.SpahrSummers@gmail.com>2012-11-04 23:08:17 -0800
commita2a618948c38d381a741c5799b87f7ff62da8c65 (patch)
tree6bdc86bbac76e8f5257bfb54e474ff5d10cc2fe0
parent83885891f583ab447f98f1c7a637f1f507e1be22 (diff)
downloadlibgit2-a2a618948c38d381a741c5799b87f7ff62da8c65.tar.gz
remote: Add malformed remote load test
-rw-r--r--tests-clar/network/remotes.c11
-rw-r--r--tests-clar/resources/testrepo.git/config2
2 files changed, 11 insertions, 2 deletions
diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c
index 21a3aaa41..d53b1723f 100644
--- a/tests-clar/network/remotes.c
+++ b/tests-clar/network/remotes.c
@@ -183,13 +183,13 @@ void test_network_remotes__list(void)
git_config *cfg;
cl_git_pass(git_remote_list(&list, _repo));
- cl_assert(list.count == 3);
+ cl_assert(list.count == 4);
git_strarray_free(&list);
cl_git_pass(git_repository_config(&cfg, _repo));
cl_git_pass(git_config_set_string(cfg, "remote.specless.url", "http://example.com"));
cl_git_pass(git_remote_list(&list, _repo));
- cl_assert(list.count == 4);
+ cl_assert(list.count == 5);
git_strarray_free(&list);
git_config_free(cfg);
@@ -269,3 +269,10 @@ void test_network_remotes__tagopt(void)
git_config_free(cfg);
}
+
+void test_network_remotes__cannot_load_with_an_empty_url(void)
+{
+ git_remote *remote;
+
+ cl_git_fail(git_remote_load(&remote, _repo, "empty-remote-url"));
+}
diff --git a/tests-clar/resources/testrepo.git/config b/tests-clar/resources/testrepo.git/config
index 54ff6109b..3801ce08d 100644
--- a/tests-clar/resources/testrepo.git/config
+++ b/tests-clar/resources/testrepo.git/config
@@ -8,6 +8,8 @@
fetch = +refs/heads/*:refs/remotes/test/*
[remote "joshaber"]
url = git://github.com/libgit2/libgit2
+[remote "empty-remote-url"]
+ url =
[remote "test_with_pushurl"]
url = git://github.com/libgit2/fetchlibgit2