aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.iplog/src/org
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-06-18 23:02:57 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-06-25 17:58:01 -0700
commit5cfc29b491eece0ceb71e653763b6cc771e7bdfe (patch)
tree196b31592fbc21f5f677a4d0e34abd03ecdca831 /org.eclipse.jgit.iplog/src/org
parent133c987f4db0788043b79e33582d0c0d4d6ce09a (diff)
downloadjgit-5cfc29b491eece0ceb71e653763b6cc771e7bdfe.tar.gz
jgit-5cfc29b491eece0ceb71e653763b6cc771e7bdfe.zip
Replace WindowCache with ObjectReader
The WindowCache is an implementation detail of PackFile and how its used by ObjectDirectory. Lets start to hide it and replace the public API with a more generic concept, ObjectReader. Because PackedObjectLoader is also considered a private detail of PackFile, we have to make PackWriter temporarily dependent upon the WindowCursor and thus FileRepository and ObjectDirectory in order to just start the refactoring. In later changes we will clean up the APIs more, exposing sufficient support to PackWriter without needing the file specific implementation details. Change-Id: I676be12b57f3534f1285854ee5de1aa483895398 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.iplog/src/org')
-rw-r--r--org.eclipse.jgit.iplog/src/org/eclipse/jgit/iplog/IpLogGenerator.java7
1 files changed, 4 insertions, 3 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 f64c329847..f40c3896a0 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
@@ -86,7 +86,7 @@ import org.eclipse.jgit.lib.MutableObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
import org.eclipse.jgit.lib.PersonIdent;
import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.lib.WindowCursor;
+import org.eclipse.jgit.lib.ObjectReader;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevTree;
import org.eclipse.jgit.revwalk.RevWalk;
@@ -144,7 +144,7 @@ public class IpLogGenerator {
private NameConflictTreeWalk tw;
- private final WindowCursor curs = new WindowCursor();
+ private ObjectReader curs;
private final MutableObjectId idbuf = new MutableObjectId();
@@ -184,6 +184,7 @@ public class IpLogGenerator {
throws IOException, ConfigInvalidException {
try {
db = repo;
+ curs = db.newObjectReader();
rw = new RevWalk(db);
tw = new NameConflictTreeWalk(db);
@@ -194,7 +195,7 @@ public class IpLogGenerator {
scanProjectCommits(meta.getProjects().get(0), c);
commits.add(c);
} finally {
- WindowCursor.release(curs);
+ curs.release();
db = null;
rw = null;
tw = null;