]> source.dussan.org Git - gitblit.git/commitdiff
Include tags on incremental commit indexing
authorJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 23:46:19 +0000 (19:46 -0400)
committerJames Moger <james.moger@gitblit.com>
Tue, 20 Mar 2012 23:46:19 +0000 (19:46 -0400)
src/com/gitblit/LuceneExecutor.java

index a425cc3d1099e40cad6dfd0b6f3f7b0b477c3649..65e1b2be70162e86cc2684c32db8b870ca4b4eb7 100644 (file)
@@ -655,8 +655,17 @@ public class LuceneExecutor implements Runnable {
                                }\r
                        }\r
                        writer.commit();\r
-\r
-                       Document doc = createDocument(commit, null);\r
+                       \r
+                       // get any annotated commit tags\r
+                       List<String> commitTags = new ArrayList<String>();\r
+                       for (RefModel ref : JGitUtils.getTags(repository, true, -1)) {\r
+                               if (ref.isAnnotatedTag() && ref.getReferencedObjectId().equals(commit.getId())) {\r
+                                       commitTags.add(ref.displayName);\r
+                               }\r
+                       }\r
+                       \r
+                       // create and write the Lucene document\r
+                       Document doc = createDocument(commit, commitTags);\r
                        doc.add(new Field(FIELD_BRANCH, branch, Store.YES, Index.ANALYZED));\r
                        result.commitCount++;\r
                        result.success = index(repositoryName, doc);\r