diff options
author | Robin Stocker <robin@nibor.org> | 2013-12-10 00:13:08 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2013-12-12 02:21:41 +0100 |
commit | 0ce61caefbcada30fb1cc4f3b037560f1ba4a8b7 (patch) | |
tree | 1a1c205477389876c50bdfa00060843c76d04549 /org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java | |
parent | be7942f2ba046320f02e30598f204e4f47a16d35 (diff) | |
download | jgit-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.java | 2 |
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. |