diff options
author | James Moger <james.moger@gitblit.com> | 2012-08-07 08:14:15 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-08-07 08:14:15 -0400 |
commit | 749110b462b3147c6dfff076fb5d1bf0460a4f99 (patch) | |
tree | c5a1868c02e8196db4588d5df8317702ef4732a9 /src/com/gitblit/LuceneExecutor.java | |
parent | a02998032e7077e3e744d5725485023097bf30f0 (diff) | |
download | gitblit-749110b462b3147c6dfff076fb5d1bf0460a4f99.tar.gz gitblit-749110b462b3147c6dfff076fb5d1bf0460a4f99.zip |
Do not incrementally index blobs in submodules (issue 119)
Diffstat (limited to 'src/com/gitblit/LuceneExecutor.java')
-rw-r--r-- | src/com/gitblit/LuceneExecutor.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java index eafb5168..d1c27f4d 100644 --- a/src/com/gitblit/LuceneExecutor.java +++ b/src/com/gitblit/LuceneExecutor.java @@ -494,6 +494,7 @@ public class LuceneExecutor implements Runnable { Map<String, ObjectId> paths = new TreeMap<String, ObjectId>();
while (treeWalk.next()) {
+ // ensure path is not in a submodule
if (treeWalk.getFileMode(0) != FileMode.GITLINK) {
paths.put(treeWalk.getPathString(), treeWalk.getObjectId(0));
}
@@ -679,8 +680,10 @@ public class LuceneExecutor implements Runnable { // read the blob content
String str = JGitUtils.getStringContent(repository, commit.getTree(),
path.path, encodings);
- doc.add(new Field(FIELD_CONTENT, str, Store.YES, Index.ANALYZED));
- writer.addDocument(doc);
+ if (str != null) {
+ doc.add(new Field(FIELD_CONTENT, str, Store.YES, Index.ANALYZED));
+ writer.addDocument(doc);
+ }
}
}
}
|