aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2010-01-02 17:19:29 +0100
committerShawn O. Pearce <spearce@spearce.org>2010-01-06 18:33:15 -0800
commitaa4b1157910f674ab49033f8bc8e03658d4631a1 (patch)
tree916de2840632cb99b69bf0f889a37cb157be3edc /org.eclipse.jgit
parent7085c0e4acb70b7d4a07e99d7a9bea3554d0fc62 (diff)
downloadjgit-aa4b1157910f674ab49033f8bc8e03658d4631a1.tar.gz
jgit-aa4b1157910f674ab49033f8bc8e03658d4631a1.zip
Read core.worktree regardless of whether .git was discovered or not
The C Git documentation stated that the core.worktree config was not read when the .git directory was found implicitly (from the working directory). This was not true, and had not been so for a long time. The documentation has been updated to document the existing behaviour. Change-Id: If1e81b6a981b9d70e849f24872f01c110e9bc950 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java14
1 files changed, 5 insertions, 9 deletions
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 a50132bc63..bbc5cc2a6a 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();
}
}