mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 06:25:51 +01:00
Insert project info into database before actual git repository creation.
This commit is contained in:
@@ -33,6 +33,10 @@ trait CreateRepositoryControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
* Create new repository.
|
* Create new repository.
|
||||||
*/
|
*/
|
||||||
post("/new", form) { form =>
|
post("/new", form) { form =>
|
||||||
|
// Insert to the database at first
|
||||||
|
createProject(form.name, context.loginUser, Some(form.description))
|
||||||
|
|
||||||
|
// Create the actual repository
|
||||||
val gitdir = getRepositoryDir(context.loginUser, form.name)
|
val gitdir = getRepositoryDir(context.loginUser, form.name)
|
||||||
val repository = new RepositoryBuilder().setGitDir(gitdir).setBare.build
|
val repository = new RepositoryBuilder().setGitDir(gitdir).setBare.build
|
||||||
|
|
||||||
@@ -63,9 +67,6 @@ trait CreateRepositoryControllerBase extends ControllerBase { self: ProjectServi
|
|||||||
FileUtils.deleteDirectory(tmpdir)
|
FileUtils.deleteDirectory(tmpdir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// insert to the database
|
|
||||||
createProject(form.name, context.loginUser, Some(form.description))
|
|
||||||
|
|
||||||
// redirect to the repository
|
// redirect to the repository
|
||||||
redirect("/%s/%s".format(context.loginUser, form.name))
|
redirect("/%s/%s".format(context.loginUser, form.name))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user