aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
diff options
context:
space:
mode:
authorRobin Stocker <robin@nibor.org>2013-12-10 00:13:08 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2013-12-12 02:21:41 +0100
commit0ce61caefbcada30fb1cc4f3b037560f1ba4a8b7 (patch)
tree1a1c205477389876c50bdfa00060843c76d04549 /org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
parentbe7942f2ba046320f02e30598f204e4f47a16d35 (diff)
downloadjgit-0ce61caefbcada30fb1cc4f3b037560f1ba4a8b7.tar.gz
jgit-0ce61caefbcada30fb1cc4f3b037560f1ba4a8b7.zip
Canonicalize worktree path in BaseRepositoryBuilder if set via config
This is the case for submodules in .git/modules, which typically have a worktree config of "../../../dir". This can confuse callers, which e.g. try to call Repository.stripWorkDir with it. Bug: 423644 Change-Id: I0c00953f73f9316a66d0fc10eab52d8779c88f00 Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
index db622f319d..7a6ddb39a1 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java
@@ -695,7 +695,7 @@ public class BaseRepositoryBuilder<B extends BaseRepositoryBuilder, R extends Re
String path = cfg.getString(CONFIG_CORE_SECTION, null,
CONFIG_KEY_WORKTREE);
if (path != null)
- return safeFS().resolve(getGitDir(), path);
+ return safeFS().resolve(getGitDir(), path).getCanonicalFile();
// If core.bare is set, honor its value. Assume workTree is
// the parent directory of the repository.