diff options
author | Ben Straub <bs@github.com> | 2012-12-21 08:05:59 -0800 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2012-12-21 08:05:59 -0800 |
commit | 79000951ec907c967a1c322da8c351998676f753 (patch) | |
tree | 35fac0fcd93f4ccf876d48eb34957ae8ee0b2b3c /tests-clar | |
parent | 87bc689fbf571aa3cbc77e510f14304cc3502ca5 (diff) | |
download | libgit2-79000951ec907c967a1c322da8c351998676f753.tar.gz |
In-memory remotes don't have names
Diffstat (limited to 'tests-clar')
-rw-r--r-- | tests-clar/network/remotelocal.c | 2 | ||||
-rw-r--r-- | tests-clar/network/remoterename.c | 33 | ||||
-rw-r--r-- | tests-clar/network/remotes.c | 8 |
3 files changed, 15 insertions, 28 deletions
diff --git a/tests-clar/network/remotelocal.c b/tests-clar/network/remotelocal.c index 1839679de..01492ac50 100644 --- a/tests-clar/network/remotelocal.c +++ b/tests-clar/network/remotelocal.c @@ -50,7 +50,7 @@ static void connect_to_local_repository(const char *local_repository) { git_buf_sets(&file_path_buf, cl_git_path_url(local_repository)); - cl_git_pass(git_remote_create_inmemory(&remote, repo, NULL, git_buf_cstr(&file_path_buf), NULL)); + cl_git_pass(git_remote_create_inmemory(&remote, repo, git_buf_cstr(&file_path_buf), NULL)); cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); } diff --git a/tests-clar/network/remoterename.c b/tests-clar/network/remoterename.c index e960cd75e..90c464ecf 100644 --- a/tests-clar/network/remoterename.c +++ b/tests-clar/network/remoterename.c @@ -148,29 +148,6 @@ void test_network_remoterename__cannot_overwrite_an_existing_remote(void) cl_assert_equal_i(GIT_EEXISTS, git_remote_rename(_remote, "test_with_pushurl", dont_call_me_cb, NULL)); } -void test_network_remoterename__renaming_an_inmemory_nameless_remote_notifies_the_inability_to_update_the_fetch_refspec(void) -{ - git_remote *remote; - - char *expected_refspecs[] = { - "+refs/heads/*:refs/remotes/volatile/*", - NULL - }; - - assert_config_entry_existence(_repo, "remote.volatile.url", false); - - cl_git_pass(git_remote_create_inmemory( - &remote, - _repo, - NULL, - "git://github.com/libgit2/volatile.git", - "+refs/heads/*:refs/remotes/volatile/*")); - - cl_git_pass(git_remote_rename(remote, "durable", ensure_refspecs, &expected_refspecs)); - - git_remote_free(remote); -} - void test_network_remoterename__renaming_a_remote_moves_the_underlying_reference(void) { git_reference *underlying; @@ -185,3 +162,13 @@ void test_network_remoterename__renaming_a_remote_moves_the_underlying_reference cl_git_pass(git_reference_lookup(&underlying, _repo, "refs/remotes/just/renamed/master")); git_reference_free(underlying); } + +void test_network_remoterename__cannot_rename_an_inmemory_remote(void) +{ + git_remote *remote; + + cl_git_pass(git_remote_create_inmemory(&remote, _repo, "file:///blah", NULL)); + cl_git_fail(git_remote_rename(remote, "newname", NULL, NULL)); + + git_remote_free(remote); +} diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c index b776353a2..456fbc3b1 100644 --- a/tests-clar/network/remotes.c +++ b/tests-clar/network/remotes.c @@ -255,7 +255,7 @@ void test_network_remotes__cant_save_inmem_remote(void) { git_remote *remote; - cl_git_pass(git_remote_create_inmemory(&remote, _repo, NULL, "git://github.com/libgit2/libgit2", NULL)); + cl_git_pass(git_remote_create_inmemory(&remote, _repo, "git://github.com/libgit2/libgit2", NULL)); cl_git_fail(git_remote_save(remote)); git_remote_free(remote); @@ -282,12 +282,12 @@ void test_network_remotes__cannot_initialize_a_remote_with_an_invalid_name(void) cl_assert_equal_i( GIT_EINVALIDSPEC, - git_remote_create_inmemory(&remote, _repo, "Inv@{id", "git://github.com/libgit2/libgit2", NULL)); + git_remote_create(&remote, _repo, "Inv@{id", "git://github.com/libgit2/libgit2")); cl_assert_equal_p(remote, NULL); cl_assert_equal_i( GIT_EINVALIDSPEC, - git_remote_create_inmemory(&remote, _repo, "", "git://github.com/libgit2/libgit2", NULL)); + git_remote_create(&remote, _repo, "", "git://github.com/libgit2/libgit2")); cl_assert_equal_p(remote, NULL); } @@ -331,7 +331,7 @@ void test_network_remotes__check_structure_version(void) git_remote_free(_remote); _remote = NULL; - cl_git_pass(git_remote_create_inmemory(&_remote, _repo, NULL, "test-protocol://localhost", NULL)); + cl_git_pass(git_remote_create_inmemory(&_remote, _repo, "test-protocol://localhost", NULL)); transport.version = 0; cl_git_fail(git_remote_set_transport(_remote, &transport)); |