Skip to content

Commit fe9a5dd

Browse files
committed
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.
1 parent 2d48678 commit fe9a5dd

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/network/remote/local.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,3 +465,19 @@ void test_network_remote_local__push_delete(void)
465465
cl_fixture_cleanup("target.git");
466466
cl_git_sandbox_cleanup();
467467
}
468+
469+
void test_network_remote_local__anonymous_remote_inmemory_repo(void)
470+
{
471+
git_repository *inmemory;
472+
git_remote *remote;
473+
474+
git_buf_sets(&file_path_buf, cl_git_path_url(cl_fixture("testrepo.git")));
475+
476+
cl_git_pass(git_repository_new(&inmemory));
477+
cl_git_pass(git_remote_create_anonymous(&remote, inmemory, git_buf_cstr(&file_path_buf)));
478+
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL, NULL, NULL));
479+
cl_assert(git_remote_connected(remote));
480+
git_remote_disconnect(remote);
481+
git_remote_free(remote);
482+
git_repository_free(inmemory);
483+
}

0 commit comments

Comments
 (0)