diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-06-23 10:09:27 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-06-23 17:29:37 -0700 |
commit | 8e396bcddc2c945a2a90f6842c1a481a16c7be52 (patch) | |
tree | bb21bbd696ac83cdbb8a2361679678c8c0b4a2f0 | |
parent | dc10dd6fc85e1c6c69c74ff64db8f4c8c7c4c50b (diff) | |
download | jgit-8e396bcddc2c945a2a90f6842c1a481a16c7be52.tar.gz jgit-8e396bcddc2c945a2a90f6842c1a481a16c7be52.zip |
Use higher level Config types when possible
We don't have to assume/depend on RepositoryConfig here, these
two tests can use higher level versions of the class and still
come up with the same test. That frees us up to do some changes
to the RepositoryConfig API.
Change-Id: Ia7b263c8c5efa3fae1054416d39c546867288132
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
3 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java index 80d14ced00..d96857498d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java @@ -283,7 +283,7 @@ public class T0003_Basic extends SampleDataRepositoryTestCase { } public void test005_ReadSimpleConfig() { - final RepositoryConfig c = db.getConfig(); + final Config c = db.getConfig(); assertNotNull(c); assertEquals("0", c.getString("core", null, "repositoryformatversion")); assertEquals("0", c.getString("CoRe", null, "REPOSITORYFoRmAtVeRsIoN")); @@ -294,8 +294,8 @@ public class T0003_Basic extends SampleDataRepositoryTestCase { public void test006_ReadUglyConfig() throws IOException, ConfigInvalidException { - final RepositoryConfig c = db.getConfig(); final File cfg = new File(db.getDirectory(), "config"); + final FileBasedConfig c = new FileBasedConfig(cfg); final FileWriter pw = new FileWriter(cfg); final String configStr = " [core];comment\n\tfilemode = yes\n" + "[user]\n" diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java index e3518251fe..a6bdd8886f 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java @@ -48,7 +48,7 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import org.eclipse.jgit.lib.RepositoryConfig; +import org.eclipse.jgit.lib.Config; import org.eclipse.jgit.lib.SampleDataRepositoryTestCase; public class TransportTest extends SampleDataRepositoryTestCase { @@ -59,7 +59,7 @@ public class TransportTest extends SampleDataRepositoryTestCase { @Override public void setUp() throws Exception { super.setUp(); - final RepositoryConfig config = db.getConfig(); + final Config config = db.getConfig(); remoteConfig = new RemoteConfig(config, "test"); remoteConfig.addURI(new URIish("http://everyones.loves.git/u/2")); transport = null; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java index 5da33fd6bb..42c16cb108 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java @@ -352,7 +352,7 @@ public class GitIndex { // to change this for testing. if (filemode != null) return filemode.booleanValue(); - RepositoryConfig config = db.getConfig(); + Config config = db.getConfig(); filemode = Boolean.valueOf(config.getBoolean("core", null, "filemode", true)); return filemode.booleanValue(); } |