Commit 209425ce26d777794e9995f757656c7731df087e

Carlos Martín Nieto 2014-11-08T13:25:51

remote: rename _load() to _lookup() This brings it in line with the rest of the lookup functions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 786668c..5c8d45d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -85,6 +85,9 @@ v0.21 + 1
   resfpecs to be the active list, similarly to how git fetch accepts a
   list on the command-line.
 
+* Rename git_remote_load() to git_remote_lookup() to bring it in line
+  with the rest of the lookup functions.
+
 * Introduce git_merge_bases() and the git_oidarray type to expose all
   merge bases between two commits.
 
diff --git a/examples/network/fetch.c b/examples/network/fetch.c
index ab78fc9..adde73c 100644
--- a/examples/network/fetch.c
+++ b/examples/network/fetch.c
@@ -90,7 +90,7 @@ int fetch(git_repository *repo, int argc, char **argv)
 
 	// Figure out whether it's a named remote or a URL
 	printf("Fetching %s for repo %p\n", argv[1], repo);
-	if (git_remote_load(&remote, repo, argv[1]) < 0) {
+	if (git_remote_lookup(&remote, repo, argv[1]) < 0) {
 		if (git_remote_create_anonymous(&remote, repo, argv[1], NULL) < 0)
 			return -1;
 	}
diff --git a/examples/network/ls-remote.c b/examples/network/ls-remote.c
index a5c14ce..5e3ade9 100644
--- a/examples/network/ls-remote.c
+++ b/examples/network/ls-remote.c
@@ -13,7 +13,7 @@ static int use_remote(git_repository *repo, char *name)
 	git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
 
 	// Find the remote by name
-	error = git_remote_load(&remote, repo, name);
+	error = git_remote_lookup(&remote, repo, name);
 	if (error < 0) {
 		error = git_remote_create_anonymous(&remote, repo, name, NULL);
 		if (error < 0)
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 717830f..0d7fd23 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -94,7 +94,7 @@ GIT_EXTERN(int) git_remote_create_anonymous(
  * @param name the remote's name
  * @return 0, GIT_ENOTFOUND, GIT_EINVALIDSPEC or an error code
  */
-GIT_EXTERN(int) git_remote_load(git_remote **out, git_repository *repo, const char *name);
+GIT_EXTERN(int) git_remote_lookup(git_remote **out, git_repository *repo, const char *name);
 
 /**
  * Save a remote to its repository's configuration
diff --git a/src/branch.c b/src/branch.c
index 5276085..9a3cb07 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -360,7 +360,7 @@ int git_branch_upstream_name(
 	}
 
 	if (strcmp(".", remote_name) != 0) {
-		if ((error = git_remote_load(&remote, repo, remote_name)) < 0)
+		if ((error = git_remote_lookup(&remote, repo, remote_name)) < 0)
 			goto cleanup;
 
 		refspec = git_remote__matching_refspec(remote, merge_name);
@@ -411,7 +411,7 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
 
 	/* Find matching remotes */
 	for (i = 0; i < remote_list.count; i++) {
-		if ((error = git_remote_load(&remote, repo, remote_list.strings[i])) < 0)
+		if ((error = git_remote_lookup(&remote, repo, remote_list.strings[i])) < 0)
 			continue;
 
 		fetchspec = git_remote__matching_dst_refspec(remote, refname);
@@ -556,7 +556,7 @@ int git_branch_set_upstream(git_reference *branch, const char *upstream_name)
 			goto on_error;
 	} else {
 		/* Get the remoe-tracking branch's refname in its repo */
-		if (git_remote_load(&remote, repo, git_buf_cstr(&value)) < 0)
+		if (git_remote_lookup(&remote, repo, git_buf_cstr(&value)) < 0)
 			goto on_error;
 
 		fetchspec = git_remote__matching_dst_refspec(remote, git_reference_name(upstream));
diff --git a/src/remote.c b/src/remote.c
index 0007c41..4b9993d 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -186,7 +186,7 @@ static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
 	int error;
 	git_remote *remote;
 
-	error = git_remote_load(&remote, repo, name);
+	error = git_remote_lookup(&remote, repo, name);
 
 	if (error == GIT_ENOTFOUND)
 		return 0;
@@ -350,7 +350,7 @@ static int get_optional_config(
 	return error;
 }
 
-int git_remote_load(git_remote **out, git_repository *repo, const char *name)
+int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
 {
 	git_remote *remote;
 	git_buf buf = GIT_BUF_INIT;
@@ -1677,7 +1677,7 @@ int git_remote_rename(git_strarray *out, git_repository *repo, const char *name,
 
 	assert(out && repo && name && new_name);
 
-	if ((error = git_remote_load(&remote, repo, name)) < 0)
+	if ((error = git_remote_lookup(&remote, repo, name)) < 0)
 		return error;
 
 	if ((error = ensure_remote_name_is_valid(new_name)) < 0)
@@ -2010,7 +2010,7 @@ static int remove_remote_tracking(git_repository *repo, const char *remote_name)
 	size_t i, count;
 
 	/* we want to use what's on the config, regardless of changes to the instance in memory */
-	if ((error = git_remote_load(&remote, repo, remote_name)) < 0)
+	if ((error = git_remote_lookup(&remote, repo, remote_name)) < 0)
 		return error;
 
 	count = git_remote_refspec_count(remote);
diff --git a/src/submodule.c b/src/submodule.c
index ccc8ad1..8dca0ae 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1876,7 +1876,7 @@ static int lookup_head_remote(git_remote **remote, git_repository *repo)
 
 	/* lookup remote of remote tracking branch name */
 	if (!(error = lookup_head_remote_key(&remote_name, repo)))
-		error = git_remote_load(remote, repo, remote_name.ptr);
+		error = git_remote_lookup(remote, repo, remote_name.ptr);
 
 	git_buf_free(&remote_name);
 
@@ -1890,7 +1890,7 @@ static int lookup_default_remote(git_remote **remote, git_repository *repo)
 
 	/* if that failed, use 'origin' instead */
 	if (error == GIT_ENOTFOUND)
-		error = git_remote_load(remote, repo, "origin");
+		error = git_remote_lookup(remote, repo, "origin");
 
 	if (error == GIT_ENOTFOUND)
 		giterr_set(
diff --git a/tests/clone/local.c b/tests/clone/local.c
index f14b33c..91a0a1c 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 e985331..a0264b0 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 c8191c5..4894818 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 f4f0921..736261b 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 ac6cfcc..f811f3c 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 2cdf922..a5e1ba2 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 49929a4..1dabd07 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 13abd39..cae7b33 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 ce92ee8..ec16dd2 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 bd423bb..b0a80cd 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 189b089..56fd6b8 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 a3e3502..05dbafd 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)