mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 20:34:15 +00:00
remote: accept a repo and name for renaming
Remote objects are not meant to be changed from under the user. We did this in rename, but only the name and left the refspecs, such that a save would save the wrong refspecs (and a fetch and anything else would use the wrong refspecs). Instead, let's simply take a name and not change any loaded remote from under the user.
This commit is contained in:
@@ -94,12 +94,10 @@ void test_submodule_add__url_relative(void)
|
||||
g_repo = cl_git_sandbox_init("testrepo2");
|
||||
|
||||
/* make sure we don't default to origin - rename origin -> test_remote */
|
||||
cl_git_pass(git_remote_load(&remote, g_repo, "origin"));
|
||||
cl_git_pass(git_remote_rename(&problems, remote, "test_remote"));
|
||||
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"));
|
||||
git_remote_free(remote);
|
||||
|
||||
cl_git_pass(
|
||||
git_submodule_add_setup(&sm, g_repo, "../TestGitRepository", "TestGitRepository", 1)
|
||||
|
||||
Reference in New Issue
Block a user