mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 15:10:02 +00:00
remote: make git_remote_load() return GIT_ENOTFOUND when the remote url cannot be retrieved from the config file
This commit is contained in:
parent
2fb9d6de95
commit
9fb70f378a
@ -112,10 +112,8 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (git_config_get_string(config, git_buf_cstr(&buf), &val) < 0) {
|
||||
error = -1;
|
||||
if ((error = git_config_get_string(config, git_buf_cstr(&buf), &val)) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
remote->repo = repo;
|
||||
remote->url = git__strdup(val);
|
||||
|
@ -153,3 +153,8 @@ void test_network_remotes__list(void)
|
||||
|
||||
git_config_free(cfg);
|
||||
}
|
||||
|
||||
void test_network_remotes__loading_a_missing_remote_returns_ENOTFOUND(void)
|
||||
{
|
||||
cl_assert_equal_i(GIT_ENOTFOUND, git_remote_load(&_remote, _repo, "just-left-few-minutes-ago"));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user