aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMykola Nikishov2009-11-29 16:30:23 (EST)
committerMykola Nikishov2009-12-19 17:36:41 (EST)
commit2c13813e93ca6f091f801b03c451943766f05c86 (patch)
treeaf5d738f9d2bda2c378911ad24740d5ca153535a
parent9fd991fcc6c8cde8eda431cfd8a87fa7ff0637f6 (diff)
downloadegit-2c13813e93ca6f091f801b03c451943766f05c86.zip
egit-2c13813e93ca6f091f801b03c451943766f05c86.tar.gz
egit-2c13813e93ca6f091f801b03c451943766f05c86.tar.bz2
Get a suggested directory name to clone to using just introducedrefs/changes/16/116/2
URIish.getHumanishName() Change-Id: If3c61a2a8454277cb4299472a9a4413ca2fd4421 Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java12
1 files changed, 1 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
index e5a5f38..998814e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/clone/CloneDestinationPage.java
@@ -305,7 +305,7 @@ class CloneDestinationPage extends WizardPage {
if (!sourcePage.selectionEquals(validatedRepoSelection)) {
validatedRepoSelection = sourcePage.getSelection();
// update repo-related selection only if it changed
- final String n = getSuggestedName();
+ final String n = validatedRepoSelection.getURI().getHumanishName();
setDescription(NLS.bind(UIText.CloneDestinationPage_description, n));
directoryText.setText(new File(ResourcesPlugin.getWorkspace()
.getRoot().getRawLocation().toFile(), n).getAbsolutePath());
@@ -329,16 +329,6 @@ class CloneDestinationPage extends WizardPage {
checkPage();
}
- private String getSuggestedName() {
- String path = validatedRepoSelection.getURI().getPath();
- int s = path.lastIndexOf('/');
- if (s != -1)
- path = path.substring(s + 1);
- if (path.endsWith(".git")) //$NON-NLS-1$
- path = path.substring(0, path.length() - 4);
- return path;
- }
-
@Override
public boolean canFlipToNextPage() {
return super.canFlipToNextPage() && showImportWizard.getSelection();