Browse Source

SystemReader: Respect passed-in parent when no system config is present

The default implementation of openSystemConfig has special handling for
when the FS returns null from getGitSystemConfig: it should return a
"real" FileBasedConfig instance that never actually tries to load a
file. However, this codepath was not respecting the passed-in parent
config.

Change-Id: Id0bcdc93bb42f9ebe3f5ee4c6b4be8863e0133f9
stable-5.3
Dave Borowitz 6 years ago
parent
commit
04bd5821e9
  1. 2
      org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

2
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

@ -101,7 +101,7 @@ public abstract class SystemReader {
public FileBasedConfig openSystemConfig(Config parent, FS fs) { public FileBasedConfig openSystemConfig(Config parent, FS fs) {
File configFile = fs.getGitSystemConfig(); File configFile = fs.getGitSystemConfig();
if (configFile == null) { if (configFile == null) {
return new FileBasedConfig(null, fs) { return new FileBasedConfig(parent, null, fs) {
@Override @Override
public void load() { public void load() {
// empty, do not load // empty, do not load

Loading…
Cancel
Save