From 9e2f9ddbe46e88c919834940352dcead61ac7a02 Mon Sep 17 00:00:00 2001 From: James Moger Date: Sat, 10 Mar 2012 14:10:48 -0500 Subject: Lucene adjustments --- src/com/gitblit/utils/LuceneUtils.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/com/gitblit') diff --git a/src/com/gitblit/utils/LuceneUtils.java b/src/com/gitblit/utils/LuceneUtils.java index fe36a838..3b3c30e1 100644 --- a/src/com/gitblit/utils/LuceneUtils.java +++ b/src/com/gitblit/utils/LuceneUtils.java @@ -292,12 +292,13 @@ public class LuceneUtils { TreeWalk treeWalk = new TreeWalk(repository); treeWalk.addTree(branchHead.getTree()); treeWalk.setRecursive(true); + while (treeWalk.next()) { result.blobCount++; String blobPath = treeWalk.getPathString(); RevCommit blobRev = branchHead; - + RevWalk blobWalk = null; if (fullIndex) { // XXX this is _really_ slow, there must be a better way @@ -308,11 +309,7 @@ public class LuceneUtils { PathFilterGroup.createFromStrings(Collections.singleton(blobPath)), TreeFilter.ANY_DIFF); blobWalk.setTreeFilter(filter); - - for (RevCommit commit : blobWalk) { - blobRev = commit; - break; - } + blobRev = blobWalk.next(); } String blobAuthor = getAuthor(blobRev); @@ -321,7 +318,7 @@ public class LuceneUtils { Resolution.MINUTE); if (blobWalk != null) { - blobWalk.dispose(); + blobWalk.dispose(); } Document doc = new Document(); -- cgit v1.2.3