aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-09-12 05:59:09 -0400
committerMichael Keppler2018-09-13 05:09:45 -0400
commit5d14d64e685dc3e3b2213742a2e48e5354597fb6 (patch)
tree6d4d1aa638c90b285ad43874d92631cb508f25ec
parentb3b288586115eca03868fb8a49b4094e8e903f51 (diff)
downloadegit-5d14d64e685dc3e3b2213742a2e48e5354597fb6.tar.gz
egit-5d14d64e685dc3e3b2213742a2e48e5354597fb6.tar.xz
egit-5d14d64e685dc3e3b2213742a2e48e5354597fb6.zip
Normalize default repository directory
Avoid relative path parts like \..\ to appear in the repository directory string. Bug: 538971 Change-Id: I31afe1d6426b0a963a454948f5f8041a7eec68ea Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
index 909ad8c9b..9fa40413e 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java
@@ -61,6 +61,7 @@ import org.eclipse.jgit.treewalk.TreeWalk;
import org.eclipse.jgit.treewalk.WorkingTreeIterator;
import org.eclipse.jgit.treewalk.filter.PathFilterGroup;
import org.eclipse.jgit.util.FS;
+import org.eclipse.jgit.util.FileUtils;
import org.osgi.service.prefs.BackingStoreException;
/**
@@ -141,7 +142,7 @@ public class RepositoryUtil {
result = ResourcesPlugin.getWorkspace().getRoot().getRawLocation()
.toOSString();
}
- return result;
+ return FileUtils.canonicalize(new File(result)).toString();
}
@NonNull