Skip to content

Commit

Permalink
Fixed bug in create/rename repository if the root group alias is spec…
Browse files Browse the repository at this point in the history
…ified (issue 143)
  • Loading branch information
gitblit committed Oct 5, 2012
1 parent 6662e38 commit 2c60de5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/04_releases.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions src/com/gitblit/GitBlit.java
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,13 @@ private boolean getConfig(StoredConfig config, String field, boolean defaultValu
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)) {
Expand Down

0 comments on commit 2c60de5

Please sign in to comment.