mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 21:56:44 +00:00
remote: Add malformed remote load test
This commit is contained in:
parent
83885891f5
commit
a2a618948c
@ -183,13 +183,13 @@ void test_network_remotes__list(void)
|
|||||||
git_config *cfg;
|
git_config *cfg;
|
||||||
|
|
||||||
cl_git_pass(git_remote_list(&list, _repo));
|
cl_git_pass(git_remote_list(&list, _repo));
|
||||||
cl_assert(list.count == 3);
|
cl_assert(list.count == 4);
|
||||||
git_strarray_free(&list);
|
git_strarray_free(&list);
|
||||||
|
|
||||||
cl_git_pass(git_repository_config(&cfg, _repo));
|
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_config_set_string(cfg, "remote.specless.url", "http://example.com"));
|
||||||
cl_git_pass(git_remote_list(&list, _repo));
|
cl_git_pass(git_remote_list(&list, _repo));
|
||||||
cl_assert(list.count == 4);
|
cl_assert(list.count == 5);
|
||||||
git_strarray_free(&list);
|
git_strarray_free(&list);
|
||||||
|
|
||||||
git_config_free(cfg);
|
git_config_free(cfg);
|
||||||
@ -269,3 +269,10 @@ void test_network_remotes__tagopt(void)
|
|||||||
|
|
||||||
git_config_free(cfg);
|
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"));
|
||||||
|
}
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
fetch = +refs/heads/*:refs/remotes/test/*
|
fetch = +refs/heads/*:refs/remotes/test/*
|
||||||
[remote "joshaber"]
|
[remote "joshaber"]
|
||||||
url = git://github.com/libgit2/libgit2
|
url = git://github.com/libgit2/libgit2
|
||||||
|
[remote "empty-remote-url"]
|
||||||
|
url =
|
||||||
|
|
||||||
[remote "test_with_pushurl"]
|
[remote "test_with_pushurl"]
|
||||||
url = git://github.com/libgit2/fetchlibgit2
|
url = git://github.com/libgit2/fetchlibgit2
|
||||||
|
Loading…
Reference in New Issue
Block a user