aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-23 10:11:34 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-23 17:29:38 -0700
commite1b312b5f7e1010c3633df2582f6a20373becdf3 (patch)
treed1fb4390c518a86efa036183e45fa77dd06d426c /org.eclipse.jgit/src
parent8e396bcddc2c945a2a90f6842c1a481a16c7be52 (diff)
downloadjgit-e1b312b5f7e1010c3633df2582f6a20373becdf3.tar.gz
jgit-e1b312b5f7e1010c3633df2582f6a20373becdf3.zip
Use CoreConfig, UserConfig and TransferConfig directly
Rather than relying on the helpers in RepositoryConfig to get these objects, obtain them directly through the Config API. Its only slightly more verbose, but permits us to work with the base Config class, which is more flexible than the highly file specific RepositoryConfig. This is what I really meant to do when I added the section parser and caching support to Config, we just failed to finish updating all of the call sites. Change-Id: I481cb365aa00bfa8c21e5ad0cd367ddd9c6c0edd Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java6
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDirectory.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java4
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java2
5 files changed, 10 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java
index 48f41a5586..75cc4662e0 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PackWriter.java
@@ -238,8 +238,10 @@ public class PackWriter {
this.db = repo;
initMonitor = imonitor == null ? NullProgressMonitor.INSTANCE : imonitor;
writeMonitor = wmonitor == null ? NullProgressMonitor.INSTANCE : wmonitor;
- this.deflater = new Deflater(db.getConfig().getCore().getCompression());
- outputVersion = repo.getConfig().getCore().getPackIndexVersion();
+
+ final CoreConfig coreConfig = db.getConfig().get(CoreConfig.KEY);
+ this.deflater = new Deflater(coreConfig.getCompression());
+ outputVersion = coreConfig.getPackIndexVersion();
}
/**
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
index 522f8477b1..0406684ea7 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/PersonIdent.java
@@ -77,7 +77,7 @@ public class PersonIdent {
* @param repo
*/
public PersonIdent(final Repository repo) {
- final RepositoryConfig config = repo.getConfig();
+ final UserConfig config = repo.getConfig().get(UserConfig.KEY);
name = config.getCommitterName();
emailAddress = config.getCommitterEmail();
when = SystemReader.getInstance().getCurrentTime();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDirectory.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDirectory.java
index 302b63b486..e306baabb3 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDirectory.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/RefDirectory.java
@@ -590,7 +590,7 @@ public class RefDirectory extends RefDatabase {
}
private boolean isLogAllRefUpdates() {
- return parent.getConfig().getCore().isLogAllRefUpdates();
+ return parent.getConfig().get(CoreConfig.KEY).isLogAllRefUpdates();
}
private boolean shouldAutoCreateLog(final String refName) {
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
index 2a5b4344f5..f6e04107f6 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/IndexPack.java
@@ -67,6 +67,7 @@ import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.BinaryDelta;
import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.CoreConfig;
import org.eclipse.jgit.lib.InflaterCache;
import org.eclipse.jgit.lib.MutableObjectId;
import org.eclipse.jgit.lib.ObjectChecker;
@@ -127,7 +128,8 @@ public class IndexPack {
base = new File(objdir, n.substring(0, n.length() - suffix.length()));
final IndexPack ip = new IndexPack(db, is, base);
- ip.setIndexVersion(db.getConfig().getCore().getPackIndexVersion());
+ ip.setIndexVersion(db.getConfig().get(CoreConfig.KEY)
+ .getPackIndexVersion());
return ip;
}
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
index e1988a6c85..a8e47afd38 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java
@@ -566,7 +566,7 @@ public abstract class Transport {
* URI passed to {@link #open(Repository, URIish)}.
*/
protected Transport(final Repository local, final URIish uri) {
- final TransferConfig tc = local.getConfig().getTransfer();
+ final TransferConfig tc = local.getConfig().get(TransferConfig.KEY);
this.local = local;
this.uri = uri;
this.checkFetchedObjects = tc.isFsckObjects();