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>
This commit is contained in:
parent
7085c0e4ac
commit
aa4b115791
|
@ -215,15 +215,11 @@ public Repository(final File d, final File workTree, final File objectDir,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workDir == null) {
|
if (workDir == null) {
|
||||||
if (d != null) {
|
String workTreeConfig = getConfig().getString("core", null, "worktree");
|
||||||
// Only read core.worktree if GIT_DIR is set explicitly. See
|
if (workTreeConfig != null) {
|
||||||
// git-config(1).
|
workDir = FS.resolve(d, workTreeConfig);
|
||||||
String workTreeConfig = getConfig().getString("core", null, "worktree");
|
} else {
|
||||||
if (workTreeConfig != null) {
|
workDir = gitDir.getParentFile();
|
||||||
workDir = FS.resolve(d, workTreeConfig);
|
|
||||||
} else {
|
|
||||||
workDir = gitDir.getParentFile();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue