summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-03-20 19:46:19 -0400
committerJames Moger <james.moger@gitblit.com>2012-03-20 19:46:19 -0400
commit261024bc3e9bbedf7637b357552f55f0e392d887 (patch)
tree13cd76d288502e203df6f18f986c335fb5410e78
parent58a1e415ff0cda6884cf004766b603e3763b0ac0 (diff)
downloadgitblit-261024bc3e9bbedf7637b357552f55f0e392d887.tar.gz
gitblit-261024bc3e9bbedf7637b357552f55f0e392d887.zip
Include tags on incremental commit indexing
-rw-r--r--src/com/gitblit/LuceneExecutor.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/com/gitblit/LuceneExecutor.java b/src/com/gitblit/LuceneExecutor.java
index a425cc3d..65e1b2be 100644
--- a/src/com/gitblit/LuceneExecutor.java
+++ b/src/com/gitblit/LuceneExecutor.java
@@ -655,8 +655,17 @@ public class LuceneExecutor implements Runnable {
}
}
writer.commit();
-
- Document doc = createDocument(commit, null);
+
+ // get any annotated commit tags
+ List<String> commitTags = new ArrayList<String>();
+ for (RefModel ref : JGitUtils.getTags(repository, true, -1)) {
+ if (ref.isAnnotatedTag() && ref.getReferencedObjectId().equals(commit.getId())) {
+ commitTags.add(ref.displayName);
+ }
+ }
+
+ // create and write the Lucene document
+ Document doc = createDocument(commit, commitTags);
doc.add(new Field(FIELD_BRANCH, branch, Store.YES, Index.ANALYZED));
result.commitCount++;
result.success = index(repositoryName, doc);