summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2012-10-05 18:00:24 -0400
committerJames Moger <james.moger@gitblit.com>2012-10-05 18:00:24 -0400
commit2c60de580f6452365a6f25c998b7dd1ca68f7181 (patch)
tree41ccf227b13f720557b1e6e8b0a779a41d1c29e4
parent6662e38a4e252b6ed455ca8f11729d0f1440a3b0 (diff)
downloadgitblit-2c60de580f6452365a6f25c998b7dd1ca68f7181.tar.gz
gitblit-2c60de580f6452365a6f25c998b7dd1ca68f7181.zip
Fixed bug in create/rename repository if the root group alias is specified (issue 143)
-rw-r--r--docs/04_releases.mkd1
-rw-r--r--src/com/gitblit/GitBlit.java7
2 files changed, 8 insertions, 0 deletions
diff --git a/docs/04_releases.mkd b/docs/04_releases.mkd
index 33362343..ad7a9930 100644
--- a/docs/04_releases.mkd
+++ b/docs/04_releases.mkd
@@ -11,6 +11,7 @@ If you are updating from an earlier release AND you have indexed branches with t
#### fixes
+- Fixed bug in create/rename repository if you explicitly specified the alias for the root group (e.g. main/myrepo) (issue 143)
- Wrapped Markdown parser with improved exception handler (issue 142)
- Fixed duplicate entries in repository cache (issue 140)
- Fixed connection leak in LDAPUserService (issue 139)
diff --git a/src/com/gitblit/GitBlit.java b/src/com/gitblit/GitBlit.java
index e945fa06..7fbd3efd 100644
--- a/src/com/gitblit/GitBlit.java
+++ b/src/com/gitblit/GitBlit.java
@@ -1547,6 +1547,13 @@ public class GitBlit implements ServletContextListener {
public void updateRepositoryModel(String repositoryName, RepositoryModel repository,
boolean isCreate) throws GitBlitException {
Repository r = null;
+ String projectPath = StringUtils.getFirstPathElement(repository.name);
+ if (!StringUtils.isEmpty(projectPath)) {
+ if (projectPath.equalsIgnoreCase(getString(Keys.web.repositoryRootGroupName, "main"))) {
+ // strip leading group name
+ repository.name = repository.name.substring(projectPath.length() + 1);
+ }
+ }
if (isCreate) {
// ensure created repository name ends with .git
if (!repository.name.toLowerCase().endsWith(org.eclipse.jgit.lib.Constants.DOT_GIT_EXT)) {