From d7eb67bba682c4c59fb2480d9e1830c8477ce71e Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 31 Dec 2012 16:13:51 -0500
Subject: [PATCH] Reset build identifiers for the next release
---
src/com/gitblit/GitBlit.java | 29 +++++++++++++++++++----------
1 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index c2d4a85..076bb76 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -1339,7 +1339,7 @@
}
// check for updates
- Repository r = getRepository(repositoryName);
+ Repository r = getRepository(model.name);
if (r == null) {
// repository is missing
removeFromCachedRepositoryList(repositoryName);
@@ -1652,7 +1652,18 @@
* @return true if the repository exists
*/
public boolean hasRepository(String repositoryName) {
- if (settings.getBoolean(Keys.git.cacheRepositoryList, true)) {
+ return hasRepository(repositoryName, false);
+ }
+
+ /**
+ * Determines if this server has the requested repository.
+ *
+ * @param name
+ * @param caseInsensitive
+ * @return true if the repository exists
+ */
+ public boolean hasRepository(String repositoryName, boolean caseSensitiveCheck) {
+ if (!caseSensitiveCheck && settings.getBoolean(Keys.git.cacheRepositoryList, true)) {
// if we are caching use the cache to determine availability
// otherwise we end up adding a phantom repository to the cache
return repositoryListCache.containsKey(repositoryName.toLowerCase());
@@ -1937,7 +1948,7 @@
if (!repository.name.toLowerCase().endsWith(org.eclipse.jgit.lib.Constants.DOT_GIT_EXT)) {
repository.name += org.eclipse.jgit.lib.Constants.DOT_GIT_EXT;
}
- if (new File(repositoriesFolder, repository.name).exists()) {
+ if (hasRepository(repository.name)) {
throw new GitBlitException(MessageFormat.format(
"Can not create repository ''{0}'' because it already exists.",
repository.name));
@@ -3044,22 +3055,20 @@
ServletContext context = contextEvent.getServletContext();
WebXmlSettings webxmlSettings = new WebXmlSettings(context);
- // 0.7.0 web.properties in the deployed war folder
- String webProps = context.getRealPath("/WEB-INF/web.properties");
+ // gitblit.properties file located within the webapp
+ String webProps = context.getRealPath("/WEB-INF/gitblit.properties");
if (!StringUtils.isEmpty(webProps)) {
File overrideFile = new File(webProps);
- if (overrideFile.exists()) {
- webxmlSettings.applyOverrides(overrideFile);
- }
+ webxmlSettings.applyOverrides(overrideFile);
}
-
- // 0.8.0 gitblit.properties file located outside the deployed war
+ // gitblit.properties file located outside the deployed war
// folder lie, for example, on RedHat OpenShift.
File overrideFile = getFileOrFolder("gitblit.properties");
if (!overrideFile.getPath().equals("gitblit.properties")) {
webxmlSettings.applyOverrides(overrideFile);
}
+
configureContext(webxmlSettings, true);
// Copy the included scripts to the configured groovy folder
--
Gitblit v1.9.1