]> source.dussan.org Git - gitblit.git/commitdiff
fixed renaming a repository into a new subfolder failed (issue 33)
authorJames Moger <james.moger@gitblit.com>
Tue, 27 Dec 2011 22:31:03 +0000 (17:31 -0500)
committerJames Moger <james.moger@gitblit.com>
Tue, 27 Dec 2011 22:31:03 +0000 (17:31 -0500)
docs/04_releases.mkd
src/com/gitblit/GitBlit.java

index ae2821daaef755c1fa24bc6313b7cea35e0a42ef..e03089f495baa3d0c20c196dae658da328201d55 100644 (file)
@@ -29,6 +29,7 @@ The original `users.properties` file and it's corresponding implementation are *
 - added: filters menu to repositories page and activity page.  You can filter by federation set, team, and simple custom regular expressions (issue 27)  \r
    **New:** *web.customFilters=*\r
 - fixed: several a bugs in FileUserService related to cleaning up old repository permissions on a rename or delete\r
+- fixed: renaming a repository into a new subfolder failed (issue 33)\r
 - added: optional flash-based 1-step *copy to clipboard* of the primary repository url\r
 - added: javascript-based 3-step (click, ctrl+c, enter) *copy to clipboard* of the primary repository url  \r
    **New:** *web.allowFlashCopyToClipboard = true*\r
index a62d4e40054dbb2775b30f052be07e48566e207b..a46806063dd7f873d1a82d3e9f72fe0cc2758ba4 100644 (file)
@@ -905,6 +905,11 @@ public class GitBlit implements ServletContextListener {
                                                                        .format("Can not rename repository ''{0}'' to ''{1}'' because ''{1}'' already exists.",\r
                                                                                        repositoryName, repository.name));\r
                                }\r
+                               File parentFile = destFolder.getParentFile();\r
+                               if (!parentFile.exists() && !parentFile.mkdirs()) {\r
+                                       throw new GitBlitException(MessageFormat.format(\r
+                                                       "Failed to create folder ''{0}''", parentFile.getAbsolutePath()));\r
+                               }\r
                                if (!folder.renameTo(destFolder)) {\r
                                        throw new GitBlitException(MessageFormat.format(\r
                                                        "Failed to rename repository ''{0}'' to ''{1}''.", repositoryName,\r