From e462bbf2974d33f1a5a0b2a808e150aa0e22d6f4 Mon Sep 17 00:00:00 2001 From: James Moger Date: Wed, 5 Mar 2014 21:50:16 -0500 Subject: Fire an event on received ticket branch updates to trigger reindex It would be useful to be able to push a complete repository with a refs/gitblit/tickets branch and have Gitblit index all those tickets. Additionally, it would be nice for the mirroring service to recognize an incoming update to this ref and fire an event that can be processed by the BranchTicketService, if so configured, to reindex the tickets. --- src/main/java/com/gitblit/git/PatchsetReceivePack.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/gitblit/git/PatchsetReceivePack.java') diff --git a/src/main/java/com/gitblit/git/PatchsetReceivePack.java b/src/main/java/com/gitblit/git/PatchsetReceivePack.java index ae429d2e..2044f604 100644 --- a/src/main/java/com/gitblit/git/PatchsetReceivePack.java +++ b/src/main/java/com/gitblit/git/PatchsetReceivePack.java @@ -436,10 +436,12 @@ public class PatchsetReceivePack extends GitblitReceivePack { case CREATE: case UPDATE: case UPDATE_NONFASTFORWARD: - Collection tickets = processMergedTickets(cmd); - ticketsProcessed += tickets.size(); - for (TicketModel ticket : tickets) { - ticketNotifier.queueMailing(ticket); + if (cmd.getRefName().startsWith(Constants.R_HEADS)) { + Collection tickets = processMergedTickets(cmd); + ticketsProcessed += tickets.size(); + for (TicketModel ticket : tickets) { + ticketNotifier.queueMailing(ticket); + } } break; default: -- cgit v1.2.3