mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-04 12:46:10 +00:00
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:
parent
2d486781df
commit
fe9a5dd3ca
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user