aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2010-06-08 12:25:25 (EDT)
committerRobin Rosenberg2010-06-08 17:29:17 (EDT)
commita6c18f57a59be879d5e236a3da96fea0f67612fd (patch)
tree529e0827b5be93e62bdeeffaafb08a0a86ed0d8a
parent42d388e933f393fa18045a8e18a59563aa1c5376 (diff)
downloadegit-a6c18f57a59be879d5e236a3da96fea0f67612fd.zip
egit-a6c18f57a59be879d5e236a3da96fea0f67612fd.tar.gz
egit-a6c18f57a59be879d5e236a3da96fea0f67612fd.tar.bz2
Adapt EGit to JGit change Ifc4278078b298781d55cf5421e9647a21fa5db24 "Repository can be configured with FS" Change-Id: Icdb60dda0477021a4be6f1032cb6fffbab983ab2 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java5
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java2
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseSshSessionFactory.java7
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RepositorySelectionPage.java6
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java3
7 files changed, 17 insertions, 12 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
index 3fbab86..466f7be 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/AdaptableFileTreeIterator.java
@@ -19,6 +19,7 @@ import org.eclipse.jgit.errors.IncorrectObjectTypeException;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.treewalk.AbstractTreeIterator;
import org.eclipse.jgit.treewalk.FileTreeIterator;
+import org.eclipse.jgit.util.FS;
/**
* Java IO file tree iterator that can adapt to a {@link ContainerTreeIterator}
@@ -49,7 +50,7 @@ public class AdaptableFileTreeIterator extends FileTreeIterator {
*/
public AdaptableFileTreeIterator(final File path,
final IWorkspaceRoot workspaceRoot) {
- super(path);
+ super(path, FS.DETECTED);
root = workspaceRoot;
}
@@ -70,7 +71,7 @@ public class AdaptableFileTreeIterator extends FileTreeIterator {
*/
protected AdaptableFileTreeIterator(final AdaptableFileTreeIterator parent,
File path, final IWorkspaceRoot workspaceRoot) {
- super(parent, path);
+ super(parent, path, FS.DETECTED);
root = workspaceRoot;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
index 2a2ed38..da29091 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/ContainerTreeIterator.java
@@ -161,7 +161,7 @@ public class ContainerTreeIterator extends WorkingTreeIterator {
switch (f.getType()) {
case IResource.FILE:
- if (FS.INSTANCE.canExecute(asFile()))
+ if (FS.DETECTED.canExecute(asFile()))
mode = FileMode.EXECUTABLE_FILE;
else
mode = FileMode.REGULAR_FILE;
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseSshSessionFactory.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseSshSessionFactory.java
index abfa87f..9aef847 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseSshSessionFactory.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/EclipseSshSessionFactory.java
@@ -14,6 +14,7 @@ import org.eclipse.jsch.core.IJSchService;
import org.eclipse.jsch.ui.UserInfoPrompter;
import org.eclipse.jgit.transport.OpenSshConfig;
import org.eclipse.jgit.transport.SshConfigSessionFactory;
+import org.eclipse.jgit.util.FS;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
@@ -27,7 +28,7 @@ class EclipseSshSessionFactory extends SshConfigSessionFactory {
}
@Override
- protected JSch createDefaultJSch() throws JSchException {
+ protected JSch createDefaultJSch(FS fs) throws JSchException {
// Forcing a dummy session to be created will cause the known hosts
// and configured private keys to be initialized. This is needed by
// our parent class in case non-default JSch instances need to be made.
@@ -38,9 +39,9 @@ class EclipseSshSessionFactory extends SshConfigSessionFactory {
@Override
protected Session createSession(final OpenSshConfig.Host hc,
- final String user, final String host, final int port)
+ final String user, final String host, final int port, FS fs)
throws JSchException {
- final JSch jsch = getJSch(hc);
+ final JSch jsch = getJSch(hc, FS.DETECTED);
if (jsch == provider.getJSch()) {
// If its the default JSch desired, let the provider
// manage the session creation for us.
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 0294c7b..2cd986b 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
@@ -173,7 +173,7 @@ public class RepositorySelectionPage extends BaseWizardPage {
try {
if(text != null) {
text = text.trim();
- if(Transport.canHandleProtocol(new URIish(text)))
+ if(Transport.canHandleProtocol(new URIish(text), FS.DETECTED))
preset = text;
}
} catch (URISyntaxException e) {
@@ -478,7 +478,7 @@ public class RepositorySelectionPage extends BaseWizardPage {
|| uri.getPass() != null || uri.getPath() == null)
return false;
if (uri.getScheme() == null)
- return FS.resolve(new File("."), uri.getPath()).isDirectory(); //$NON-NLS-1$
+ return FS.DETECTED.resolve(new File("."), uri.getPath()).isDirectory(); //$NON-NLS-1$
return false;
}
@@ -623,7 +623,7 @@ public class RepositorySelectionPage extends BaseWizardPage {
return;
}
- final File d = FS.resolve(new File("."), uri.getPath()); //$NON-NLS-1$
+ final File d = FS.DETECTED.resolve(new File("."), uri.getPath()); //$NON-NLS-1$
if (!d.exists()) {
selectionIncomplete(NLS.bind(
UIText.RepositorySelectionPage_fileNotFound, d
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
index c94ee2f..9f9955e 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
@@ -87,6 +87,7 @@ import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.lib.RepositoryConfig;
import org.eclipse.jgit.lib.RepositoryListener;
import org.eclipse.jgit.transport.RemoteConfig;
+import org.eclipse.jgit.util.FS;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.Clipboard;
@@ -1500,7 +1501,7 @@ public class RepositoriesView extends ViewPart implements ISelectionProvider,
return;
}
- if (!RepositoryCache.FileKey.isGitRepository(file)) {
+ if (!RepositoryCache.FileKey.isGitRepository(file, FS.DETECTED)) {
errorMessage = NLS
.bind(
UIText.RepositoriesView_ClipboardContentNoGitRepoMessage,
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java
index 4545060..a66fa0d 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoryPropertySource.java
@@ -29,6 +29,7 @@ import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.FileBasedConfig;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryConfig;
+import org.eclipse.jgit.util.FS;
import org.eclipse.jgit.util.SystemReader;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.preferences.ScopedPreferenceStore;
@@ -81,7 +82,7 @@ public class RepositoryPropertySource implements IPropertySource,
addActions();
effectiveConfig = rep.getConfig();
- userHomeConfig = SystemReader.getInstance().openUserConfig();
+ userHomeConfig = SystemReader.getInstance().openUserConfig(FS.DETECTED);
// TODO constant?
File configFile = new File(rep.getDirectory(), "config"); //$NON-NLS-1$
repositoryConfig = new FileBasedConfig(configFile);
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java
index 3f9d632..2d1e263 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositorySearchDialog.java
@@ -43,6 +43,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jgit.lib.RepositoryCache;
+import org.eclipse.jgit.util.FS;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -362,7 +363,7 @@ public class RepositorySearchDialog extends TitleAreaDialog {
}
if (child.isDirectory()
- && RepositoryCache.FileKey.isGitRepository(child)) {
+ && RepositoryCache.FileKey.isGitRepository(child, FS.DETECTED)) {
try {
strings.add(child.getCanonicalPath());
} catch (IOException e) {