Browse Source

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>
stable-0.9
Shawn O. Pearce 15 years ago
parent
commit
c9c57d34de
  1. 16
      org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

16
org.eclipse.jgit/src/org/eclipse/jgit/lib/Repository.java

@ -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 class Repository {
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 @@ public class Repository {
} }
} }
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 class Repository {
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…
Cancel
Save