瀏覽代碼

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>
tags/v3.2.0.201312181205-r
Robin Stocker 10 年之前
父節點
當前提交
0ce61caefb
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/BaseRepositoryBuilder.java

+ 1
- 1
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.

Loading…
取消
儲存