remote: ensure we can create an anon remote on inmemory repo

Given a wholly in-memory repository, ensure that we can create an
anonymous remote and perform actions on it.
This commit is contained in:
Edward Thomson 2017-06-12 12:00:14 +01:00
parent 2d486781df
commit fe9a5dd3ca

View File

@ -465,3 +465,19 @@ void test_network_remote_local__push_delete(void)
cl_fixture_cleanup("target.git");
cl_git_sandbox_cleanup();
}
void test_network_remote_local__anonymous_remote_inmemory_repo(void)
{
git_repository *inmemory;
git_remote *remote;
git_buf_sets(&file_path_buf, cl_git_path_url(cl_fixture("testrepo.git")));
cl_git_pass(git_repository_new(&inmemory));
cl_git_pass(git_remote_create_anonymous(&remote, inmemory, git_buf_cstr(&file_path_buf)));
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL, NULL));
cl_assert(git_remote_connected(remote));
git_remote_disconnect(remote);
git_remote_free(remote);
git_repository_free(inmemory);
}