Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-04-11 16:35:03 -0400
committerKevin Sawicki2012-04-11 16:35:03 -0400
commit98efbff146597d3a3e7b28bcaee673b5de9bce93 (patch)
tree547d12e4be9dcb3ed53eb26bbbae14b02053a150
parent32a7c939091d84c5805f0d3fcdcf5d560e34fad4 (diff)
downloadegit-github-98efbff146597d3a3e7b28bcaee673b5de9bce93.tar.gz
egit-github-98efbff146597d3a3e7b28bcaee673b5de9bce93.tar.xz
egit-github-98efbff146597d3a3e7b28bcaee673b5de9bce93.zip
Add target org as URL parameter instead of JSON post data
-rw-r--r--org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java3
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java5
2 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java
index 8e66be6b..d60c3ef3 100644
--- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java
+++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java
@@ -268,8 +268,7 @@ public class RepositoryServiceTest {
@Test
public void forkRepositoryToOrg() throws IOException {
service.forkRepository(repo, "abc");
- verify(client).post("/repos/o/n/forks",
- Collections.singletonMap("org", "abc"), Repository.class);
+ verify(client).post("/repos/o/n/forks?org=abc", null, Repository.class);
}
/**
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java
index 7e9dae70..d77069f0 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java
@@ -772,10 +772,9 @@ public class RepositoryService extends GitHubService {
StringBuilder uri = new StringBuilder(SEGMENT_REPOS);
uri.append('/').append(id);
uri.append(SEGMENT_FORKS);
- Map<String, String> params = null;
if (organization != null)
- params = Collections.singletonMap("org", organization); //$NON-NLS-1$
- return client.post(uri.toString(), params, Repository.class);
+ uri.append("?org=").append(organization);
+ return client.post(uri.toString(), null, Repository.class);
}
/**

Back to the top