diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java index a50132bc6..bbc5cc2a6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java @@ -215,15 +215,11 @@ public class Repository { } if (workDir == null) { - if (d != null) { - // Only read core.worktree if GIT_DIR is set explicitly. See - // git-config(1). - String workTreeConfig = getConfig().getString("core", null, "worktree"); - if (workTreeConfig != null) { - workDir = FS.resolve(d, workTreeConfig); - } else { - workDir = gitDir.getParentFile(); - } + String workTreeConfig = getConfig().getString("core", null, "worktree"); + if (workTreeConfig != null) { + workDir = FS.resolve(d, workTreeConfig); + } else { + workDir = gitDir.getParentFile(); } }