diff options
author | thallgren | 2011-09-25 04:14:41 +0000 |
---|---|---|
committer | Kevin Sawicki | 2011-09-25 04:14:41 +0000 |
commit | fd244b33d7ac8db13a1e876b96b8c05083244862 (patch) | |
tree | d7107bb0fb9ffe8c30e78bf4f038a95901a977ed /org.eclipse.egit.github.core/src | |
parent | 8061f4a940f143d26285112a7a6df43241423520 (diff) | |
download | egit-github-fd244b33d7ac8db13a1e876b96b8c05083244862.tar.gz egit-github-fd244b33d7ac8db13a1e876b96b8c05083244862.tar.xz egit-github-fd244b33d7ac8db13a1e876b96b8c05083244862.zip |
Add service support for editing a repository
Change-Id: Ib69f15094d568d015ab36706f553d337a73c984c
Signed-off-by: Thomas Hallgren <thomas@tada.se>
Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.egit.github.core/src')
-rw-r--r-- | org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/RepositoryService.java | 17 |
1 files changed, 17 insertions, 0 deletions
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 ca3dff80..31934c07 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 @@ -455,6 +455,23 @@ public class RepositoryService extends GitHubService { } /** + * Edit given repository + * + * @param repository + * @return edited repository + * @throws IOException + */ + public Repository editRepository(Repository repository) throws IOException { + if (repository == null) + throw new IllegalArgumentException("Repository cannot be null"); //$NON-NLS-1$ + + final String repoId = getId(repository); + StringBuilder uri = new StringBuilder(SEGMENT_REPOS); + uri.append('/').append(repoId); + return client.post(uri.toString(), repository, Repository.class); + } + + /** * Fork given repository into new repository under the currently * authenticated user. * |