From 15ee858b214591b414e406cc5d21a0fd825210db Mon Sep 17 00:00:00 2001
From: Lukasz Jader <ljaderdev@gmail.com>
Date: Mon, 13 Aug 2012 13:45:50 -0400
Subject: [PATCH] Save polish mkds as UTF-8 without BOM
---
src/com/gitblit/LuceneExecutor.java | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java
index eafb516..9cae3d5 100644
--- a/src/com/gitblit/LuceneExecutor.java
+++ b/src/com/gitblit/LuceneExecutor.java
@@ -494,6 +494,7 @@
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));
}
@@ -651,6 +652,9 @@
Resolution.MINUTE);
IndexWriter writer = getIndexWriter(repositoryName);
for (PathChangeModel path : changedPaths) {
+ if (path.isSubmodule()) {
+ continue;
+ }
// delete the indexed blob
deleteBlob(repositoryName, branch, path.name);
@@ -679,8 +683,10 @@
// 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);
+ }
}
}
}
--
Gitblit v1.9.1