aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.iplog
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-28 10:42:43 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-28 11:47:28 -0700
commit1ad2feb7b3d48d8bfedfdd03ee6ca4f599041476 (patch)
treed3c172ac4f3ca04585dd57d60ddf17db90b66064 /org.eclipse.jgit.iplog
parent9ba7bd4df452a1d005fbf770141076e901ad61d6 (diff)
downloadjgit-1ad2feb7b3d48d8bfedfdd03ee6ca4f599041476.tar.gz
jgit-1ad2feb7b3d48d8bfedfdd03ee6ca4f599041476.zip
Remove Repository.openObject(ObjectReader, AnyObjectId)
Going through ObjectReader.openObject(AnyObjectId) is faster, but also produces cleaner application level code. The error checking is done inside of the openObject method, which means it can be removed from the application code. Change-Id: Ia927b448d128005e1640362281585023582b1a3a Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.iplog')
-rw-r--r--org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
index f40c3896a0..0d98f24369 100644
--- a/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
+++ b/org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java
@@ -78,15 +78,13 @@ import org.eclipse.jgit.diff.EditList;
import org.eclipse.jgit.diff.MyersDiff;
import org.eclipse.jgit.diff.RawText;
import org.eclipse.jgit.errors.ConfigInvalidException;
-import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.iplog.Committer.ActiveRange;
import org.eclipse.jgit.lib.BlobBasedConfig;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.MutableObjectId;
-import org.eclipse.jgit.lib.ObjectLoader;
+import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
@@ -418,10 +416,7 @@ public class IpLogGenerator {
private byte[] openBlob(int side) throws IOException {
tw.getObjectId(idbuf, side);
- ObjectLoader ldr = db.openObject(curs, idbuf);
- if (ldr == null)
- throw new MissingObjectException(idbuf.copy(), Constants.OBJ_BLOB);
- return ldr.getCachedBytes();
+ return curs.openObject(idbuf, Constants.OBJ_BLOB).getCachedBytes();
}
/**