|
|
@ -45,6 +45,7 @@ package org.eclipse.jgit.api; |
|
|
|
import static org.junit.Assert.assertArrayEquals; |
|
|
|
import static org.junit.Assert.assertArrayEquals; |
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
import static org.junit.Assert.assertEquals; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.eclipse.jgit.api.RemoteSetUrlCommand.UriType; |
|
|
|
import org.eclipse.jgit.transport.RemoteConfig; |
|
|
|
import org.eclipse.jgit.transport.RemoteConfig; |
|
|
|
import org.eclipse.jgit.transport.URIish; |
|
|
|
import org.eclipse.jgit.transport.URIish; |
|
|
|
import org.junit.Test; |
|
|
|
import org.junit.Test; |
|
|
@ -58,9 +59,9 @@ public class RemoteSetUrlCommandTest extends AbstractRemoteCommandTest { |
|
|
|
|
|
|
|
|
|
|
|
// execute the command to change the fetch url
|
|
|
|
// execute the command to change the fetch url
|
|
|
|
RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); |
|
|
|
RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); |
|
|
|
cmd.setName(REMOTE_NAME); |
|
|
|
cmd.setRemoteName(REMOTE_NAME); |
|
|
|
URIish newUri = new URIish("git://test.com/test"); |
|
|
|
URIish newUri = new URIish("git://test.com/test"); |
|
|
|
cmd.setUri(newUri); |
|
|
|
cmd.setRemoteUri(newUri); |
|
|
|
RemoteConfig remote = cmd.call(); |
|
|
|
RemoteConfig remote = cmd.call(); |
|
|
|
|
|
|
|
|
|
|
|
// assert that the changed remote has the new fetch url
|
|
|
|
// assert that the changed remote has the new fetch url
|
|
|
@ -79,10 +80,10 @@ public class RemoteSetUrlCommandTest extends AbstractRemoteCommandTest { |
|
|
|
|
|
|
|
|
|
|
|
// execute the command to change the push url
|
|
|
|
// execute the command to change the push url
|
|
|
|
RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); |
|
|
|
RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); |
|
|
|
cmd.setName(REMOTE_NAME); |
|
|
|
cmd.setRemoteName(REMOTE_NAME); |
|
|
|
URIish newUri = new URIish("git://test.com/test"); |
|
|
|
URIish newUri = new URIish("git://test.com/test"); |
|
|
|
cmd.setUri(newUri); |
|
|
|
cmd.setRemoteUri(newUri); |
|
|
|
cmd.setPush(true); |
|
|
|
cmd.setUriType(UriType.PUSH); |
|
|
|
RemoteConfig remote = cmd.call(); |
|
|
|
RemoteConfig remote = cmd.call(); |
|
|
|
|
|
|
|
|
|
|
|
// assert that the changed remote has the old fetch url and the new push
|
|
|
|
// assert that the changed remote has the old fetch url and the new push
|
|
|
|