diff options
author | James Moger <james.moger@gitblit.com> | 2012-06-07 17:30:18 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-06-07 17:30:18 -0400 |
commit | ae9e157ef4e6a3708489725d4436cc15d273308f (patch) | |
tree | 5d93ddebf97927205789d702ae8eebc5e613ff08 /src/com/gitblit/LuceneExecutor.java | |
parent | 47867891efc2aa996fa78f7c224e46d65dc04457 (diff) | |
download | gitblit-ae9e157ef4e6a3708489725d4436cc15d273308f.tar.gz gitblit-ae9e157ef4e6a3708489725d4436cc15d273308f.zip |
Try multiple encodings when working with string blobs (issue 97)
Diffstat (limited to 'src/com/gitblit/LuceneExecutor.java')
-rw-r--r-- | src/com/gitblit/LuceneExecutor.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java index afd1cc5a..b3165434 100644 --- a/src/com/gitblit/LuceneExecutor.java +++ b/src/com/gitblit/LuceneExecutor.java @@ -642,6 +642,7 @@ public class LuceneExecutor implements Runnable { String branch, RevCommit commit) {
IndexResult result = new IndexResult();
try {
+ String [] encodings = storedSettings.getStrings(Keys.web.blobEncodings).toArray(new String[0]);
List<PathChangeModel> changedPaths = JGitUtils.getFilesInCommit(repository, commit);
String revDate = DateTools.timeToString(commit.getCommitTime() * 1000L,
Resolution.MINUTE);
@@ -674,7 +675,7 @@ public class LuceneExecutor implements Runnable { if (StringUtils.isEmpty(ext) || !excludedExtensions.contains(ext)) {
// read the blob content
String str = JGitUtils.getStringContent(repository, commit.getTree(),
- path.path);
+ path.path, encodings);
doc.add(new Field(FIELD_CONTENT, str, Store.YES, Index.ANALYZED));
writer.addDocument(doc);
}
|