Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Wagenknecht2015-02-24 16:25:54 +0000
committerGunnar Wagenknecht2015-03-03 11:13:12 +0000
commitb0489b7342659e22cd7683ec6a696891fc5f8474 (patch)
treeb074a869808298d33104e269d59d777fb0940d55 /org.eclipse.egit.ui.test
parent37ee66c68e352dd49d338d520b8e7cad1f7f9dc8 (diff)
downloadegit-b0489b7342659e22cd7683ec6a696891fc5f8474.tar.gz
egit-b0489b7342659e22cd7683ec6a696891fc5f8474.tar.xz
egit-b0489b7342659e22cd7683ec6a696891fc5f8474.zip
Fix behavior of EGit when repo is a symlink
The use of getCanonicalPath is problematic on POSIX file systems. If the repo is a symlink (or one folder of the repo path) then this will be resolved to the real file system location. There are multiple issues with that. Most notably is the fact that Eclipse resource locations will not use the canonical path but an absolute path. This translates into a couple of weird issue with RepositoryMapping and resolving paths. This change removes every occurence of getCanonicalPath() calls, which should also be line with what JGit does. Bug: 460118 Change-Id: I884eded8b24c2de14f0255d2371d016b4e435c28 Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org>
Diffstat (limited to 'org.eclipse.egit.ui.test')
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
index c8cdb0a5bf..32cb71f4ca 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/wizards/share/SharingWizardTest.java
@@ -133,7 +133,7 @@ public class SharingWizardTest extends LocalRepositoryTestCase {
if (!(gitDirParent.toString() + File.separator)
.startsWith(workspacePath.toString() + File.separator))
if (!(gitDirParent.toString() + File.separator)
- .startsWith(getTestDirectory().getCanonicalPath()
+ .startsWith(getTestDirectory().getAbsolutePath()
.toString() + File.separator))
fail("Attempting cleanup of directory neither in workspace nor test directory"
+ canonicalFile);
@@ -197,7 +197,7 @@ public class SharingWizardTest extends LocalRepositoryTestCase {
public void shareProjectWithAlreadyCreatedRepos() throws IOException,
InterruptedException, JGitInternalException, GitAPIException {
Repository repo1 = FileRepositoryBuilder.create(new File(
- createProject(projectName1), "../.git"));
+ new File(createProject(projectName1)).getParent(), ".git"));
repo1.create();
repo1.close();
Repository repo2 = FileRepositoryBuilder.create(new File(
@@ -242,10 +242,10 @@ public class SharingWizardTest extends LocalRepositoryTestCase {
existingOrNewPage.assertEnabling(false, false, true);
bot.button("Finish").click();
Thread.sleep(1000);
- assertEquals(repo1.getDirectory().getCanonicalPath(), RepositoryMapping
+ assertEquals(repo1.getDirectory().getAbsolutePath(), RepositoryMapping
.getMapping(workspace.getRoot().getProject(projectName1))
.getRepository().getDirectory().toString());
- assertEquals(repo2.getDirectory().getCanonicalPath(), RepositoryMapping
+ assertEquals(repo2.getDirectory().getAbsolutePath(), RepositoryMapping
.getMapping(workspace.getRoot().getProject(projectName2))
.getRepository().getDirectory().toString());
}

Back to the top