From 2c60de580f6452365a6f25c998b7dd1ca68f7181 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 5 Oct 2012 18:00:24 -0400 Subject: Fixed bug in create/rename repository if the root group alias is specified (issue 143) --- src/com/gitblit/GitBlit.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/com/gitblit/GitBlit.java') 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)) { -- cgit v1.2.3