From 367505e9d8ae0f83edff1dc2392c4af1f518b4d5 Mon Sep 17 00:00:00 2001 From: James Moger <james.moger@gitblit.com> Date: Sat, 24 Dec 2011 10:25:23 -0500 Subject: [PATCH] Preliminary update to JGit 1.2.0. This will be refined. --- src/com/gitblit/GitBlit.java | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java index 835aa13..a62d4e4 100644 --- a/src/com/gitblit/GitBlit.java +++ b/src/com/gitblit/GitBlit.java @@ -25,6 +25,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -1478,6 +1479,30 @@ } return scripts; } + + public List<String> getInheritedPreReceiveScripts(RepositoryModel repository) { + Set<String> globals = new HashSet<String>(); + for (String script : getStrings(Keys.groovy.preReceiveScripts)) { + if (script.endsWith(".groovy")) { + globals.add(script.substring(0, script.lastIndexOf('.'))); + } else { + globals.add(script); + } + } + return new ArrayList<String>(globals); + } + + public List<String> getInheritedPostReceiveScripts(RepositoryModel repository) { + Set<String> globals = new HashSet<String>(); + for (String script : getStrings(Keys.groovy.postReceiveScripts)) { + if (script.endsWith(".groovy")) { + globals.add(script.substring(0, script.lastIndexOf('.'))); + } else { + globals.add(script); + } + } + return new ArrayList<String>(globals); + } /** * Notify the administrators by email. @@ -1505,7 +1530,7 @@ * @param message * @param toAddresses */ - public void sendMail(String subject, String message, ArrayList<String> toAddresses) { + public void sendMail(String subject, String message, Collection<String> toAddresses) { this.sendMail(subject, message, toAddresses.toArray(new String[0])); } -- Gitblit v1.9.1