From 6f46fa34d3078399acaa962a89900ac5db3a6116 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Tue, 27 Dec 2011 17:31:50 -0500
Subject: [PATCH] Documentation.
---
src/com/gitblit/GitBlit.java | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index c818dd5..a468060 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -905,6 +905,11 @@
.format("Can not rename repository ''{0}'' to ''{1}'' because ''{1}'' already exists.",
repositoryName, repository.name));
}
+ File parentFile = destFolder.getParentFile();
+ if (!parentFile.exists() && !parentFile.mkdirs()) {
+ throw new GitBlitException(MessageFormat.format(
+ "Failed to create folder ''{0}''", parentFile.getAbsolutePath()));
+ }
if (!folder.renameTo(destFolder)) {
throw new GitBlitException(MessageFormat.format(
"Failed to rename repository ''{0}'' to ''{1}''.", repositoryName,
@@ -1479,6 +1484,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.
--
Gitblit v1.9.1