Commit cce27d82 by Edward Thomson

git_remote_rename: propogate GIT_ENOTFOUND

parent de0c4555
...@@ -1677,7 +1677,7 @@ int git_remote_rename(git_strarray *out, git_repository *repo, const char *name, ...@@ -1677,7 +1677,7 @@ int git_remote_rename(git_strarray *out, git_repository *repo, const char *name,
assert(out && repo && name && new_name); assert(out && repo && name && new_name);
if ((error = git_remote_load(&remote, repo, name)) < 0) if ((error = git_remote_load(&remote, repo, name)) < 0)
return -1; return error;
if ((error = ensure_remote_name_is_valid(new_name)) < 0) if ((error = ensure_remote_name_is_valid(new_name)) < 0)
goto cleanup; goto cleanup;
......
...@@ -200,6 +200,15 @@ void test_network_remote_rename__overwrite_ref_in_target(void) ...@@ -200,6 +200,15 @@ void test_network_remote_rename__overwrite_ref_in_target(void)
git_branch_iterator_free(iter); git_branch_iterator_free(iter);
} }
void test_network_remote_rename__nonexistent_returns_enotfound(void)
{
git_strarray problems = {0};
int err = git_remote_rename(&problems, _repo, "nonexistent", "renamed");
cl_assert_equal_i(GIT_ENOTFOUND, err);
}
void test_network_remote_rename__symref_head(void) void test_network_remote_rename__symref_head(void)
{ {
int error; int error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment