diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java index 63eba15ab..efd61fae1 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Remote.java @@ -53,6 +53,7 @@ import org.eclipse.jgit.api.RemoteListCommand; import org.eclipse.jgit.api.RemoteRemoveCommand; import org.eclipse.jgit.api.RemoteSetUrlCommand; +import org.eclipse.jgit.api.RemoteSetUrlCommand.UriType; import org.eclipse.jgit.api.errors.JGitInternalException; import org.eclipse.jgit.pgm.internal.CLIText; import org.eclipse.jgit.pgm.opt.CmdLineParser; @@ -99,13 +100,13 @@ protected void run() throws Exception { cmd.call(); } else if ("remove".equals(command) || "rm".equals(command)) { //$NON-NLS-1$ //$NON-NLS-2$ RemoteRemoveCommand cmd = git.remoteRemove(); - cmd.setName(name); + cmd.setRemoteName(name); cmd.call(); } else if ("set-url".equals(command)) { //$NON-NLS-1$ RemoteSetUrlCommand cmd = git.remoteSetUrl(); - cmd.setName(name); - cmd.setUri(new URIish(uri)); - cmd.setPush(push); + cmd.setRemoteName(name); + cmd.setRemoteUri(new URIish(uri)); + cmd.setUriType(push ? UriType.PUSH : UriType.FETCH); cmd.call(); } else if ("update".equals(command)) { //$NON-NLS-1$ // reuse fetch command for basic implementation of remote update diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteDeleteCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteDeleteCommandTest.java index 7055daff9..50e709579 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteDeleteCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteDeleteCommandTest.java @@ -56,7 +56,7 @@ public void testDelete() throws Exception { // execute the command to remove the remote RemoteRemoveCommand cmd = Git.wrap(db).remoteRemove(); - cmd.setName(REMOTE_NAME); + cmd.setRemoteName(REMOTE_NAME); RemoteConfig remote = cmd.call(); // assert that the removed remote is the initial remote diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteSetUrlCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteSetUrlCommandTest.java index 6969c3df6..d3265fee7 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteSetUrlCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/RemoteSetUrlCommandTest.java @@ -45,6 +45,7 @@ import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; +import org.eclipse.jgit.api.RemoteSetUrlCommand.UriType; import org.eclipse.jgit.transport.RemoteConfig; import org.eclipse.jgit.transport.URIish; import org.junit.Test; @@ -58,9 +59,9 @@ public void testSetUrl() throws Exception { // execute the command to change the fetch url RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); - cmd.setName(REMOTE_NAME); + cmd.setRemoteName(REMOTE_NAME); URIish newUri = new URIish("git://test.com/test"); - cmd.setUri(newUri); + cmd.setRemoteUri(newUri); RemoteConfig remote = cmd.call(); // assert that the changed remote has the new fetch url @@ -79,10 +80,10 @@ public void testSetPushUrl() throws Exception { // execute the command to change the push url RemoteSetUrlCommand cmd = Git.wrap(db).remoteSetUrl(); - cmd.setName(REMOTE_NAME); + cmd.setRemoteName(REMOTE_NAME); URIish newUri = new URIish("git://test.com/test"); - cmd.setUri(newUri); - cmd.setPush(true); + cmd.setRemoteUri(newUri); + cmd.setUriType(UriType.PUSH); RemoteConfig remote = cmd.call(); // assert that the changed remote has the old fetch url and the new push