diff options
author | Kevin Sawicki | 2011-10-27 21:47:36 +0000 |
---|---|---|
committer | Kevin Sawicki | 2011-10-27 21:47:36 +0000 |
commit | 526db549cd36fe58291b3733a04a19f072524022 (patch) | |
tree | 3a52ed7f5fb9a0beb59c01979b1ce8e35bca118c /org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github | |
parent | 22f22afb77dd76f302c55970a09a96cab145d782 (diff) | |
download | egit-github-526db549cd36fe58291b3733a04a19f072524022.tar.gz egit-github-526db549cd36fe58291b3733a04a19f072524022.tar.xz egit-github-526db549cd36fe58291b3733a04a19f072524022.zip |
Prompt on Gist creation when multiple repositories exist.
The repository selected will be used to create the Gist.
Change-Id: I734d4cb4985438309b71a04f2e01229591484372
Signed-off-by: Kevin Sawicki <kevin@github.com>
Diffstat (limited to 'org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github')
3 files changed, 10 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java index 8c1355f8..0b41c549 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistAttachmentHandler.java @@ -94,7 +94,7 @@ public class GistAttachmentHandler extends AbstractTaskAttachmentHandler { file.setFilename(mapper.getFileName()); gist.setFiles(Collections.singletonMap(file.getFilename(), file)); - GitHubClient client = new GitHubClient(); + GitHubClient client = GistConnector.createClient(repository); AuthenticationCredentials credentials = repository .getCredentials(AuthenticationType.REPOSITORY); if (credentials != null) 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 150f3da5..c86066f7 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 @@ -42,12 +42,13 @@ public class GistConnector extends RepositoryConnector { /** * Create client for repository - * + * * @param repository * @return client */ public static GitHubClient createClient(TaskRepository repository) { - GitHubClient client = new GitHubClient(); + GitHubClient client = GitHubClient.createClient(repository + .getRepositoryUrl()); GitHub.addCredentials(client, repository); return GitHub.configureClient(client); } diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java index 7c7397f0..e2e92a3f 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java @@ -51,7 +51,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { /** * Fill task data with comments - * + * * @param repository * @param data * @param comments @@ -65,7 +65,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { /** * Get gist url - * + * * @param repositoryUrl * @param gist * @return url @@ -76,7 +76,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { /** * Fill task data with data from gist - * + * * @param repository * @param data * @param gist @@ -226,7 +226,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { RepositoryResponse response = null; Gist gist = new Gist(); - GitHubClient client = new GitHubClient(); + GitHubClient client = GistConnector.createClient(repository); AuthenticationCredentials credentials = repository .getCredentials(AuthenticationType.REPOSITORY); if (credentials != null) { @@ -291,7 +291,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { /** * Is the given Gist author the same user as configured via the task * repository's credentials? - * + * * @param repository * @param author * @return true if owner, false otherwise @@ -305,7 +305,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler { /** * Is the given Gist author the same user as configured via the task * repository's credentials? - * + * * @param repository * @param author * @return true if owner, false otherwise |