Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-07-10 20:31:41 +0000
committerKevin Sawicki2011-07-10 20:31:41 +0000
commitb7bf3825c0963484333cf78dc4556d65e3928320 (patch)
tree0dbf6555f15d17692bd2af2fbf64fe33e0edb425 /org.eclipse.mylyn.github.core
parent04a9219adac63d04ffc50d5b8384ddef38c5e8a6 (diff)
downloadegit-github-b7bf3825c0963484333cf78dc4556d65e3928320.tar.gz
egit-github-b7bf3825c0963484333cf78dc4556d65e3928320.tar.xz
egit-github-b7bf3825c0963484333cf78dc4556d65e3928320.zip
Enable clone repositories from GitHub wizard.
Supports searching for repositories by language, cloning them, and adding them to the Git Repositories view. Change-Id: Id042ca49d9f0d1e6c09eb16bb4cff16d68ff09a8 Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.core')
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHub.java11
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java3
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java3
3 files changed, 13 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHub.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHub.java
index 5b1160b1..f0f9cd53 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHub.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHub.java
@@ -20,6 +20,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.egit.github.core.RepositoryId;
+import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.client.RequestException;
/**
@@ -48,6 +49,16 @@ public class GitHub {
public static final String USER_AGENT = "GitHubEclipse/1.1.0"; //$NON-NLS-1$
/**
+ * Configure client with standard configuration
+ *
+ * @param client
+ * @return given client
+ */
+ public static GitHubClient configureClient(GitHubClient client) {
+ return client.setUserAgent(USER_AGENT);
+ }
+
+ /**
* Create status of severity with message
*
* @param severity
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java
index 6651dd0c..c70dda7a 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistConnector.java
@@ -54,13 +54,12 @@ public class GistConnector extends AbstractRepositoryConnector {
*/
public static GitHubClient createClient(TaskRepository repository) {
GitHubClient client = new GitHubClient();
- client.setUserAgent(GitHub.USER_AGENT);
AuthenticationCredentials credentials = repository
.getCredentials(AuthenticationType.REPOSITORY);
if (credentials != null)
client.setCredentials(credentials.getUserName(),
credentials.getPassword());
- return client;
+ return GitHub.configureClient(client);
}
private GistTaskDataHandler dataHandler = new GistTaskDataHandler();
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
index 693ba4b2..0ae20d88 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueConnector.java
@@ -81,13 +81,12 @@ public class IssueConnector extends AbstractRepositoryConnector {
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
- client.setUserAgent(GitHub.USER_AGENT);
AuthenticationCredentials credentials = repository
.getCredentials(AuthenticationType.REPOSITORY);
if (credentials != null)
client.setCredentials(credentials.getUserName(),
credentials.getPassword());
- return client;
+ return GitHub.configureClient(client);
}
/**

Back to the top