Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2012-06-06 17:01:43 +0000
committerKevin Sawicki2012-06-06 17:01:43 +0000
commit3dbb4dd7e04e56da8fb8f46e0b1047a7225623c5 (patch)
treeb68f1d191c65914ee275fa0cea99215a7c5e5c64 /org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn
parentaa1af9f2743923d258fb41cace54f4c9810e8b19 (diff)
downloadegit-github-3dbb4dd7e04e56da8fb8f46e0b1047a7225623c5.tar.gz
egit-github-3dbb4dd7e04e56da8fb8f46e0b1047a7225623c5.tar.xz
egit-github-3dbb4dd7e04e56da8fb8f46e0b1047a7225623c5.zip
Use API v3 endpoint for repository search API
API v2 is being removed and is now provided as a legacy v3 API. Change-Id: Id1dea03486893b25012ae72518910a7d1bb3f4b9
Diffstat (limited to 'org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn')
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java27
1 files changed, 12 insertions, 15 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
index fe92cf35..8cf00ca6 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySearchWizardPage.java
@@ -20,8 +20,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.egit.github.core.Language;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.SearchRepository;
-import org.eclipse.egit.github.core.client.GitHubClient;
-import org.eclipse.egit.github.core.client.IGitHubConstants;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.eclipse.egit.github.core.util.UrlUtils;
import org.eclipse.egit.ui.UIIcons;
@@ -62,15 +60,12 @@ import org.eclipse.ui.PlatformUI;
* Search for GitHub repositories wizard page.
*/
@SuppressWarnings("restriction")
-public class RepositorySearchWizardPage extends WizardPage implements IRepositorySearchResult {
+public class RepositorySearchWizardPage extends WizardPage implements
+ IRepositorySearchResult {
private SearchRepository[] repositories = null;
- private final GitHubClient client = new GitHubClient(
- IGitHubConstants.HOST_API_V2, -1, IGitHubConstants.PROTOCOL_HTTPS);
-
- private final RepositoryService repositoryService = new RepositoryService(
- client);
+ private final RepositoryService repositoryService;
private Text searchText;
@@ -81,11 +76,14 @@ public class RepositorySearchWizardPage extends WizardPage implements IRepositor
super("repoSearchPage", Messages.RepositorySearchWizardPage_Title, null); //$NON-NLS-1$
setDescription(Messages.RepositorySearchWizardPage_Description);
setPageComplete(false);
+
+ repositoryService = new RepositoryService();
+ GitHub.configureClient(repositoryService.getClient());
}
/**
* Get selected repositories
- *
+ *
* @return repositories
*/
protected SearchRepository[] getRepositories() {
@@ -93,7 +91,7 @@ public class RepositorySearchWizardPage extends WizardPage implements IRepositor
}
/**
- *
+ *
*/
public void createControl(Composite parent) {
final Composite root = new Composite(parent, SWT.NONE);
@@ -292,13 +290,12 @@ public class RepositorySearchWizardPage extends WizardPage implements IRepositor
}
}
- public GitRepositoryInfo getGitRepositoryInfo() throws NoRepositoryInfoException {
- GitHubClient client = GitHub
- .configureClient(new GitHubClient());
- RepositoryService service = new RepositoryService(client);
+ public GitRepositoryInfo getGitRepositoryInfo()
+ throws NoRepositoryInfoException {
String cloneUrl = null;
try {
- Repository fullRepo = service.getRepository(repositories[0]);
+ Repository fullRepo = repositoryService
+ .getRepository(repositories[0]);
cloneUrl = fullRepo.getCloneUrl();
} catch (IOException e) {
throw new NoRepositoryInfoException(e.getMessage(), e);

Back to the top