aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-28 11:54:58 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-28 11:54:58 -0700
commitacb7be2c5adb270d21182d389ce93f3bca38cd29 (patch)
tree56f8a6d9adc48a303beec91b9313537b0a7ce57a /org.eclipse.jgit.test/tst/org/eclipse/jgit
parent6b62e53b607630b6c00411741972838ced552f4d (diff)
downloadjgit-acb7be2c5adb270d21182d389ce93f3bca38cd29.tar.gz
jgit-acb7be2c5adb270d21182d389ce93f3bca38cd29.zip
Refactor Repository.openObject to be Repository.open
We drop the "Object" suffix, because its pretty clear here that we want to open an object, given that we pass in AnyObjectId as the main parameter. We also fix the calling convention to throw a MissingObjectException or IncorrectObjectTypeException, so that callers don't have to do this error checking themselves. Change-Id: I72c43353cea8372278b032f5086d52082c1eee39 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java4
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReader.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java2
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java10
4 files changed, 9 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java
index 8e7df41a8d..c8f2aad759 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/ConcurrentRepackTest.java
@@ -158,7 +158,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase {
final File[] out1 = pack(eden, o1);
assertEquals(o1.name(), parse(o1).name());
- final ObjectLoader load1 = db.openBlob(o1);
+ final ObjectLoader load1 = db.open(o1, Constants.OBJ_BLOB);
assertNotNull(load1);
final RevObject o2 = writeBlob(eden, "o2");
@@ -173,7 +173,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase {
// earlier still resolve the object, even though its underlying
// pack is gone, but the object still exists.
//
- final ObjectLoader load2 = db.openBlob(o1);
+ final ObjectLoader load2 = db.open(o1, Constants.OBJ_BLOB);
assertNotNull(load2);
assertNotSame(load1, load2);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReader.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReader.java
index 70016f9ea1..b8bcca2e14 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReader.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/T0004_PackReader.java
@@ -79,7 +79,7 @@ public class T0004_PackReader extends SampleDataRepositoryTestCase {
final ObjectLoader or;
id = ObjectId.fromString("5b6e7c66c276e7610d4a73c70ec1a1f7c1003259");
- or = db.openObject(id);
+ or = db.open(id);
assertNotNull(or);
assertTrue(or instanceof PackedObjectLoader);
assertEquals(Constants.OBJ_BLOB, or.getType());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java
index 89b91558ba..177a1d5cf7 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/WindowCacheGetTest.java
@@ -126,7 +126,7 @@ public class WindowCacheGetTest extends SampleDataRepositoryTestCase {
private void doCacheTests() throws IOException {
for (final TestObject o : toLoad) {
- final ObjectLoader or = db.openObject(o.id);
+ final ObjectLoader or = db.open(o.id, o.type);
assertNotNull(or);
assertTrue(or instanceof PackedObjectLoader);
assertEquals(o.type, or.getType());
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java
index cb1ce6f382..0bcdbcea41 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/ReceivePackRefFilterTest.java
@@ -299,8 +299,8 @@ public class ReceivePackRefFilterTest extends LocalDiskRepositoryTestCase {
//
final TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(64);
packHeader(pack, 2);
- copy(pack, src.openObject(N));
- copy(pack,src.openObject(s.parseBody(N).getTree()));
+ copy(pack, src.open(N));
+ copy(pack,src.open(s.parseBody(N).getTree()));
digest(pack);
final TemporaryBuffer.Heap inBuf = new TemporaryBuffer.Heap(256);
@@ -341,8 +341,8 @@ public class ReceivePackRefFilterTest extends LocalDiskRepositoryTestCase {
//
final TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(64);
packHeader(pack, 2);
- copy(pack, src.openObject(N));
- copy(pack,src.openObject(s.parseBody(N).getTree()));
+ copy(pack, src.open(N));
+ copy(pack,src.open(s.parseBody(N).getTree()));
digest(pack);
final TemporaryBuffer.Heap inBuf = new TemporaryBuffer.Heap(256);
@@ -381,7 +381,7 @@ public class ReceivePackRefFilterTest extends LocalDiskRepositoryTestCase {
//
final TemporaryBuffer.Heap pack = new TemporaryBuffer.Heap(64);
packHeader(pack, 1);
- copy(pack, src.openObject(N));
+ copy(pack, src.open(N));
digest(pack);
final TemporaryBuffer.Heap inBuf = new TemporaryBuffer.Heap(256);