aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blewitt2010-06-20 18:02:54 (EDT)
committerMatthias Sohn2010-06-20 18:02:54 (EDT)
commit062f4eebf29aac712abea8a8f748691050c25baa (patch)
treee3d929bc3b9254745bce03cebfa5ca2dc8cedc43
parent29b7ae92f1e4dec4a17ba6078e499342f2df83ea (diff)
downloadegit-062f4eebf29aac712abea8a8f748691050c25baa.zip
egit-062f4eebf29aac712abea8a8f748691050c25baa.tar.gz
egit-062f4eebf29aac712abea8a8f748691050c25baa.tar.bz2
Enable HTTP clipboard contents only if .git is presentrefs/changes/07/907/2
When selecting a repository from the clipboard, don't be over-eager with the HTTP or HTTPS URLs, and only pre-fill those with .git in their name. If the URL has a space, trim at that, rather than everything. Bug: 315589 Change-Id: If44ab93169b7245bfeff3f89b061419c987d7562 Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
index c63a850..8493e0e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java
@@ -171,8 +171,13 @@ public class RepositorySelectionPage extends BaseWizardPage {
try {
if(text != null) {
text = text.trim();
- if(Transport.canHandleProtocol(new URIish(text), FS.DETECTED))
- preset = text;
+ int index = text.indexOf(' ');
+ if(index > 0)
+ text = text.substring(0,index);
+ if(Transport.canHandleProtocol(new URIish(text), FS.DETECTED)) {
+ if(!text.startsWith("http") || text.contains(".git")) //$NON-NLS-1$ //$NON-NLS-2$
+ preset = text;
+ }
}
} catch (URISyntaxException e) {
preset = null;