diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-08 13:25:51 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-08 13:28:27 +0100 |
commit | 209425ce26d777794e9995f757656c7731df087e (patch) | |
tree | 5e4788483721b5f1e17c83c15873c36f47f64806 /tests | |
parent | 4e1b3b3b7186b017223b8302a51289ff92ccba25 (diff) | |
download | libgit2-209425ce26d777794e9995f757656c7731df087e.tar.gz |
remote: rename _load() to _lookup()cmn/remote-lookup
This brings it in line with the rest of the lookup functions.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/clone/local.c | 4 | ||||
-rw-r--r-- | tests/clone/nonetwork.c | 4 | ||||
-rw-r--r-- | tests/fetchhead/nonetwork.c | 2 | ||||
-rw-r--r-- | tests/network/fetchlocal.c | 4 | ||||
-rw-r--r-- | tests/network/remote/createthenload.c | 2 | ||||
-rw-r--r-- | tests/network/remote/remotes.c | 24 | ||||
-rw-r--r-- | tests/network/remote/rename.c | 8 | ||||
-rw-r--r-- | tests/online/clone.c | 4 | ||||
-rw-r--r-- | tests/online/fetch.c | 2 | ||||
-rw-r--r-- | tests/online/fetchhead.c | 2 | ||||
-rw-r--r-- | tests/repo/init.c | 2 | ||||
-rw-r--r-- | tests/submodule/add.c | 2 |
12 files changed, 30 insertions, 30 deletions
diff --git a/tests/clone/local.c b/tests/clone/local.c index f14b33c17..91a0a1c2a 100644 --- a/tests/clone/local.c +++ b/tests/clone/local.c @@ -171,7 +171,7 @@ void test_clone_local__standard_unc_paths_are_written_git_style(void) cl_git_pass(git_style_unc_path(&git_unc, "localhost", path)); cl_git_pass(git_clone(&repo, unc.ptr, "./clone.git", &opts)); - cl_git_pass(git_remote_load(&remote, repo, "origin")); + cl_git_pass(git_remote_lookup(&remote, repo, "origin")); cl_assert_equal_s(git_unc.ptr, git_remote_url(remote)); @@ -198,7 +198,7 @@ void test_clone_local__git_style_unc_paths(void) cl_git_pass(git_style_unc_path(&git_unc, "localhost", path)); cl_git_pass(git_clone(&repo, git_unc.ptr, "./clone.git", &opts)); - cl_git_pass(git_remote_load(&remote, repo, "origin")); + cl_git_pass(git_remote_lookup(&remote, repo, "origin")); cl_assert_equal_s(git_unc.ptr, git_remote_url(remote)); diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c index e9853313e..a0264b0d0 100644 --- a/tests/clone/nonetwork.c +++ b/tests/clone/nonetwork.c @@ -128,14 +128,14 @@ void test_clone_nonetwork__custom_origin_name(void) g_options.remote_cb = custom_origin_name_remote_create; cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options)); - cl_git_pass(git_remote_load(&g_remote, g_repo, "my_origin")); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, "my_origin")); } void test_clone_nonetwork__defaults(void) { cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", NULL)); cl_assert(g_repo); - cl_git_pass(git_remote_load(&g_remote, g_repo, "origin")); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, "origin")); } void test_clone_nonetwork__cope_with_already_existing_directory(void) diff --git a/tests/fetchhead/nonetwork.c b/tests/fetchhead/nonetwork.c index c8191c5f5..489481826 100644 --- a/tests/fetchhead/nonetwork.c +++ b/tests/fetchhead/nonetwork.c @@ -331,7 +331,7 @@ void test_fetchhead_nonetwork__unborn_with_upstream(void) cl_git_pass(git_clone(&repo, "./test1", "./repowithunborn", NULL)); /* Simulate someone pushing to it by changing to one that has stuff */ - cl_git_pass(git_remote_load(&remote, repo, "origin")); + cl_git_pass(git_remote_lookup(&remote, repo, "origin")); cl_git_pass(git_remote_set_url(remote, cl_fixture("testrepo.git"))); cl_git_pass(git_remote_save(remote)); diff --git a/tests/network/fetchlocal.c b/tests/network/fetchlocal.c index f4f0921fb..736261b31 100644 --- a/tests/network/fetchlocal.c +++ b/tests/network/fetchlocal.c @@ -137,7 +137,7 @@ void test_network_fetchlocal__multi_remotes(void) cl_set_cleanup(&cleanup_sandbox, NULL); callbacks.transfer_progress = transfer_cb; - cl_git_pass(git_remote_load(&test, repo, "test")); + cl_git_pass(git_remote_lookup(&test, repo, "test")); cl_git_pass(git_remote_set_url(test, cl_git_fixture_url("testrepo.git"))); git_remote_set_callbacks(test, &callbacks); cl_git_pass(git_remote_connect(test, GIT_DIRECTION_FETCH)); @@ -148,7 +148,7 @@ void test_network_fetchlocal__multi_remotes(void) cl_assert_equal_i(32, (int)refnames.count); git_strarray_free(&refnames); - cl_git_pass(git_remote_load(&test2, repo, "test_with_pushurl")); + cl_git_pass(git_remote_lookup(&test2, repo, "test_with_pushurl")); cl_git_pass(git_remote_set_url(test2, cl_git_fixture_url("testrepo.git"))); git_remote_set_callbacks(test2, &callbacks); cl_git_pass(git_remote_connect(test2, GIT_DIRECTION_FETCH)); diff --git a/tests/network/remote/createthenload.c b/tests/network/remote/createthenload.c index ac6cfccd3..f811f3c4c 100644 --- a/tests/network/remote/createthenload.c +++ b/tests/network/remote/createthenload.c @@ -16,7 +16,7 @@ void test_network_remote_createthenload__initialize(void) cl_git_pass(git_config_set_string(_config, "remote.origin.url", url)); git_config_free(_config); - cl_git_pass(git_remote_load(&_remote, _repo, "origin")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "origin")); } void test_network_remote_createthenload__cleanup(void) diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c index 2cdf9226e..a5e1ba2e3 100644 --- a/tests/network/remote/remotes.c +++ b/tests/network/remote/remotes.c @@ -11,7 +11,7 @@ void test_network_remote_remotes__initialize(void) { _repo = cl_git_sandbox_init("testrepo.git"); - cl_git_pass(git_remote_load(&_remote, _repo, "test")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "test")); _refspec = git_remote_get_refspec(_remote, 0); cl_assert(_refspec != NULL); @@ -38,7 +38,7 @@ void test_network_remote_remotes__parsing(void) cl_assert_equal_s(git_remote__urlfordirection(_remote, GIT_DIRECTION_PUSH), "git://github.com/libgit2/libgit2"); - cl_git_pass(git_remote_load(&_remote2, _repo, "test_with_pushurl")); + cl_git_pass(git_remote_lookup(&_remote2, _repo, "test_with_pushurl")); cl_assert_equal_s(git_remote_name(_remote2), "test_with_pushurl"); cl_assert_equal_s(git_remote_url(_remote2), "git://github.com/libgit2/fetchlibgit2"); cl_assert_equal_s(git_remote_pushurl(_remote2), "git://github.com/libgit2/pushlibgit2"); @@ -63,7 +63,7 @@ void test_network_remote_remotes__pushurl(void) void test_network_remote_remotes__error_when_not_found(void) { git_remote *r; - cl_git_fail_with(git_remote_load(&r, _repo, "does-not-exist"), GIT_ENOTFOUND); + cl_git_fail_with(git_remote_lookup(&r, _repo, "does-not-exist"), GIT_ENOTFOUND); cl_assert(giterr_last() != NULL); cl_assert(giterr_last()->klass == GITERR_CONFIG); @@ -181,7 +181,7 @@ void test_network_remote_remotes__save(void) _remote = NULL; /* Load it from config and make sure everything matches */ - cl_git_pass(git_remote_load(&_remote, _repo, "upstream")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "upstream")); cl_git_pass(git_remote_get_fetch_refspecs(&array, _remote)); cl_assert_equal_i(2, (int)array.count); @@ -204,7 +204,7 @@ void test_network_remote_remotes__save(void) git_remote_free(_remote); _remote = NULL; - cl_git_pass(git_remote_load(&_remote, _repo, "upstream")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "upstream")); cl_assert(git_remote_pushurl(_remote) == NULL); } @@ -241,7 +241,7 @@ void test_network_remote_remotes__missing_refspecs(void) 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_remote_load(&_remote, _repo, "specless")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "specless")); git_config_free(cfg); } @@ -302,7 +302,7 @@ void test_network_remote_remotes__loading_a_missing_remote_returns_ENOTFOUND(voi git_remote_free(_remote); _remote = NULL; - cl_assert_equal_i(GIT_ENOTFOUND, git_remote_load(&_remote, _repo, "just-left-few-minutes-ago")); + cl_assert_equal_i(GIT_ENOTFOUND, git_remote_lookup(&_remote, _repo, "just-left-few-minutes-ago")); } void test_network_remote_remotes__loading_with_an_invalid_name_returns_EINVALIDSPEC(void) @@ -310,7 +310,7 @@ void test_network_remote_remotes__loading_with_an_invalid_name_returns_EINVALIDS git_remote_free(_remote); _remote = NULL; - cl_assert_equal_i(GIT_EINVALIDSPEC, git_remote_load(&_remote, _repo, "Inv@{id")); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_remote_lookup(&_remote, _repo, "Inv@{id")); } /* @@ -333,7 +333,7 @@ void test_network_remote_remotes__add(void) git_remote_free(_remote); _remote = NULL; - cl_git_pass(git_remote_load(&_remote, _repo, "addtest")); + cl_git_pass(git_remote_lookup(&_remote, _repo, "addtest")); cl_assert_equal_i(GIT_REMOTE_DOWNLOAD_TAGS_AUTO, git_remote_autotag(_remote)); _refspec = git_vector_get(&_remote->refspecs, 0); @@ -407,7 +407,7 @@ void test_network_remote_remotes__can_load_with_an_empty_url(void) { git_remote *remote = NULL; - cl_git_pass(git_remote_load(&remote, _repo, "empty-remote-url")); + cl_git_pass(git_remote_lookup(&remote, _repo, "empty-remote-url")); cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); @@ -424,7 +424,7 @@ void test_network_remote_remotes__can_load_with_only_an_empty_pushurl(void) { git_remote *remote = NULL; - cl_git_pass(git_remote_load(&remote, _repo, "empty-remote-pushurl")); + cl_git_pass(git_remote_lookup(&remote, _repo, "empty-remote-pushurl")); cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); @@ -439,7 +439,7 @@ void test_network_remote_remotes__returns_ENOTFOUND_when_neither_url_nor_pushurl git_remote *remote = NULL; cl_git_fail_with( - git_remote_load(&remote, _repo, "no-remote-url"), GIT_ENOTFOUND); + git_remote_lookup(&remote, _repo, "no-remote-url"), GIT_ENOTFOUND); } void assert_cannot_create_remote(const char *name, int expected_error) diff --git a/tests/network/remote/rename.c b/tests/network/remote/rename.c index 49929a470..1dabd07f5 100644 --- a/tests/network/remote/rename.c +++ b/tests/network/remote/rename.c @@ -74,7 +74,7 @@ void test_network_remote_rename__renaming_a_remote_without_a_fetchrefspec_doesnt cl_git_pass(git_repository_config__weakptr(&config, _repo)); cl_git_pass(git_config_delete_entry(config, "remote.test.fetch")); - cl_git_pass(git_remote_load(&remote, _repo, "test")); + cl_git_pass(git_remote_lookup(&remote, _repo, "test")); git_remote_free(remote); assert_config_entry_existence(_repo, "remote.test.fetch", false); @@ -94,7 +94,7 @@ void test_network_remote_rename__renaming_a_remote_notifies_of_non_default_fetch cl_git_pass(git_repository_config__weakptr(&config, _repo)); cl_git_pass(git_config_set_string(config, "remote.test.fetch", "+refs/*:refs/*")); - cl_git_pass(git_remote_load(&remote, _repo, "test")); + cl_git_pass(git_remote_lookup(&remote, _repo, "test")); git_remote_free(remote); cl_git_pass(git_remote_rename(&problems, _repo, _remote_name, "just/renamed")); @@ -132,14 +132,14 @@ void test_network_remote_rename__renamed_name_is_persisted(void) git_repository *another_repo; git_strarray problems = {0}; - cl_git_fail(git_remote_load(&renamed, _repo, "just/renamed")); + cl_git_fail(git_remote_lookup(&renamed, _repo, "just/renamed")); cl_git_pass(git_remote_rename(&problems, _repo, _remote_name, "just/renamed")); cl_assert_equal_i(0, problems.count); git_strarray_free(&problems); cl_git_pass(git_repository_open(&another_repo, "testrepo.git")); - cl_git_pass(git_remote_load(&renamed, _repo, "just/renamed")); + cl_git_pass(git_remote_lookup(&renamed, _repo, "just/renamed")); git_remote_free(renamed); git_repository_free(another_repo); diff --git a/tests/online/clone.c b/tests/online/clone.c index 13abd39bd..cae7b3338 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -46,7 +46,7 @@ void test_online_clone__network_full(void) cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); cl_assert(!git_repository_is_bare(g_repo)); - cl_git_pass(git_remote_load(&origin, g_repo, "origin")); + cl_git_pass(git_remote_lookup(&origin, g_repo, "origin")); cl_assert_equal_i(GIT_REMOTE_DOWNLOAD_TAGS_AUTO, origin->download_tags); @@ -61,7 +61,7 @@ void test_online_clone__network_bare(void) cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); cl_assert(git_repository_is_bare(g_repo)); - cl_git_pass(git_remote_load(&origin, g_repo, "origin")); + cl_git_pass(git_remote_lookup(&origin, g_repo, "origin")); git_remote_free(origin); } diff --git a/tests/online/fetch.c b/tests/online/fetch.c index ce92ee82b..ec16dd2fd 100644 --- a/tests/online/fetch.c +++ b/tests/online/fetch.c @@ -120,7 +120,7 @@ void test_online_fetch__doesnt_retrieve_a_pack_when_the_repository_is_up_to_date cl_git_pass(git_repository_open(&_repository, "./fetch/lg2")); - cl_git_pass(git_remote_load(&remote, _repository, "origin")); + cl_git_pass(git_remote_lookup(&remote, _repository, "origin")); cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); cl_assert_equal_i(false, invoked); diff --git a/tests/online/fetchhead.c b/tests/online/fetchhead.c index bd423bbb0..b0a80cd58 100644 --- a/tests/online/fetchhead.c +++ b/tests/online/fetchhead.c @@ -42,7 +42,7 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet int equals = 0; git_strarray array, *active_refs = NULL; - cl_git_pass(git_remote_load(&remote, g_repo, "origin")); + cl_git_pass(git_remote_lookup(&remote, g_repo, "origin")); git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); if(fetchspec != NULL) { diff --git a/tests/repo/init.c b/tests/repo/init.c index 189b0894a..56fd6b8b6 100644 --- a/tests/repo/init.c +++ b/tests/repo/init.c @@ -358,7 +358,7 @@ void test_repo_init__extended_1(void) cl_assert_equal_s("refs/heads/development", git_reference_symbolic_target(ref)); git_reference_free(ref); - cl_git_pass(git_remote_load(&remote, _repo, "origin")); + cl_git_pass(git_remote_lookup(&remote, _repo, "origin")); cl_assert_equal_s("origin", git_remote_name(remote)); cl_assert_equal_s(opts.origin_url, git_remote_url(remote)); git_remote_free(remote); diff --git a/tests/submodule/add.c b/tests/submodule/add.c index a3e3502b7..05dbafd88 100644 --- a/tests/submodule/add.c +++ b/tests/submodule/add.c @@ -97,7 +97,7 @@ void test_submodule_add__url_relative(void) cl_git_pass(git_remote_rename(&problems, g_repo, "origin", "test_remote")); cl_assert_equal_i(0, problems.count); git_strarray_free(&problems); - cl_git_fail(git_remote_load(&remote, g_repo, "origin")); + cl_git_fail(git_remote_lookup(&remote, g_repo, "origin")); cl_git_pass( git_submodule_add_setup(&sm, g_repo, "../TestGitRepository", "TestGitRepository", 1) |