Browse Source

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>
tags/v0.9.1
Shawn O. Pearce 14 years ago
parent
commit
8e396bcddc

+ 2
- 2
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/T0003_Basic.java View File

@@ -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"

+ 2
- 2
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/TransportTest.java View File

@@ -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;

+ 1
- 1
org.eclipse.jgit/src/org/eclipse/jgit/lib/GitIndex.java View File

@@ -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();
}

Loading…
Cancel
Save