Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2015-01-25 09:08:05 +0000
committerMatthias Sohn2015-03-04 14:45:41 +0000
commit83ee9b48ea871e9b0c6016c6882975ce88984619 (patch)
treefdcb48c9b23cbb0f7f71985791484f509286041b /org.eclipse.egit.ui.test
parentcd6b5380102e2f88d5389043197062a598f6489b (diff)
downloadegit-83ee9b48ea871e9b0c6016c6882975ce88984619.tar.gz
egit-83ee9b48ea871e9b0c6016c6882975ce88984619.tar.xz
egit-83ee9b48ea871e9b0c6016c6882975ce88984619.zip
Accept git clone command as URI
It happens regularly that I copy/paste a complete git clone command from a website into the clone wizard instead of just the URI. This change makes the dialog accept such input by automatically stripping the prefix "git clone ". Change-Id: I0baf9472a4210bca59b8a8e64148e4a61cfc1354 Signed-off-by: Michael Keppler <michael.keppler@gmx.de> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
index 13354f1727..ed9ed0f257 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/clone/GitCloneWizardTest.java
@@ -288,4 +288,28 @@ public class GitCloneWizardTest extends GitCloneWizardTestBase {
remoteBranches.cancel();
}
+ @Test
+ public void acceptCloneCommandAsURI() throws Exception {
+ importWizard.openWizard();
+ RepoPropertiesPage propertiesPage = importWizard
+ .openRepoPropertiesPage();
+
+ // remove git clone command
+ propertiesPage.setURI("git clone git://www.jgit.org/EGIT");
+ propertiesPage.assertSourceParams(null, "www.jgit.org", "/EGIT", "git",
+ "", true, "", "", false, false);
+
+ // leading and trailing whitespace should be stripped automatically
+ propertiesPage.setURI(" git clone git://www.jgit.org/EGIT ");
+ propertiesPage.assertSourceParams(null, "www.jgit.org", "/EGIT", "git",
+ "", true, "", "", false, false);
+
+ // assert trimming works fine in all other places
+ propertiesPage.setURI(" git clone git://www.jgit.org/EGIT");
+ propertiesPage.assertSourceParams(null, "www.jgit.org", "/EGIT", "git",
+ "", true, "", "", false, false);
+
+ bot.button("Cancel").click();
+ }
+
}

Back to the top