Rename Repository 'config' as 'repoConfig'
This better matches with the other configuration variable, 'userConfig', and helps to make it clear what config object we are dealing with. Change-Id: I2c585649aecc805e8e66db2f094828cd2649e549 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
parent
6a822f0ebf
commit
c9c57d34de
|
@ -110,7 +110,7 @@ public class Repository {
|
||||||
|
|
||||||
private final FileBasedConfig userConfig;
|
private final FileBasedConfig userConfig;
|
||||||
|
|
||||||
private final FileBasedConfig config;
|
private final FileBasedConfig repoConfig;
|
||||||
|
|
||||||
private final RefDatabase refs;
|
private final RefDatabase refs;
|
||||||
|
|
||||||
|
@ -244,10 +244,10 @@ public Repository(final File d, final File workTree, final File objectDir,
|
||||||
this.fs = fs;
|
this.fs = fs;
|
||||||
|
|
||||||
userConfig = SystemReader.getInstance().openUserConfig(fs);
|
userConfig = SystemReader.getInstance().openUserConfig(fs);
|
||||||
config = new FileBasedConfig(userConfig, fs.resolve(gitDir, "config"));
|
repoConfig = new FileBasedConfig(userConfig, fs.resolve(gitDir, "config"));
|
||||||
|
|
||||||
loadUserConfig();
|
loadUserConfig();
|
||||||
loadConfig();
|
loadRepoConfig();
|
||||||
|
|
||||||
if (workDir == null) {
|
if (workDir == null) {
|
||||||
// if the working directory was not provided explicitly,
|
// if the working directory was not provided explicitly,
|
||||||
|
@ -317,9 +317,9 @@ private void loadUserConfig() throws IOException {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfig() throws IOException {
|
private void loadRepoConfig() throws IOException {
|
||||||
try {
|
try {
|
||||||
config.load();
|
repoConfig.load();
|
||||||
} catch (ConfigInvalidException e1) {
|
} catch (ConfigInvalidException e1) {
|
||||||
IOException e2 = new IOException(JGitText.get().unknownRepositoryFormat);
|
IOException e2 = new IOException(JGitText.get().unknownRepositoryFormat);
|
||||||
e2.initCause(e1);
|
e2.initCause(e1);
|
||||||
|
@ -417,14 +417,14 @@ public FileBasedConfig getConfig() {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (config.isOutdated()) {
|
if (repoConfig.isOutdated()) {
|
||||||
try {
|
try {
|
||||||
loadConfig();
|
loadRepoConfig();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return config;
|
return repoConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue