diff options
| author | Alex Blewitt | 2010-06-20 22:02:54 +0000 |
|---|---|---|
| committer | Matthias Sohn | 2010-06-20 22:02:54 +0000 |
| commit | 062f4eebf29aac712abea8a8f748691050c25baa (patch) | |
| tree | e3d929bc3b9254745bce03cebfa5ca2dc8cedc43 | |
| parent | 29b7ae92f1e4dec4a17ba6078e499342f2df83ea (diff) | |
| download | egit-062f4eebf29aac712abea8a8f748691050c25baa.tar.gz egit-062f4eebf29aac712abea8a8f748691050c25baa.tar.xz egit-062f4eebf29aac712abea8a8f748691050c25baa.zip | |
Enable HTTP clipboard contents only if .git is present
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.java | 9 |
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 c63a850ded..8493e0ea32 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; |
