mirror of
https://github.com/gitbucket/gitbucket.git
synced 2026-05-07 02:07:05 +02:00
Keep the default branch in the forked repositories (#2514)
This commit is contained in:
@@ -180,12 +180,14 @@ trait RepositoryCreationService {
|
||||
Database() withTransaction { implicit session =>
|
||||
val originUserName = repository.repository.originUserName.getOrElse(repository.owner)
|
||||
val originRepositoryName = repository.repository.originRepositoryName.getOrElse(repository.name)
|
||||
val originDefaultBranchName = repository.repository.defaultBranch
|
||||
|
||||
insertRepository(
|
||||
repositoryName = repository.name,
|
||||
userName = accountName,
|
||||
description = repository.repository.description,
|
||||
isPrivate = repository.repository.isPrivate,
|
||||
defaultBranch = originDefaultBranchName,
|
||||
originRepositoryName = Some(originRepositoryName),
|
||||
originUserName = Some(originUserName),
|
||||
parentRepositoryName = Some(repository.name),
|
||||
|
||||
@@ -34,6 +34,7 @@ trait RepositoryService {
|
||||
userName: String,
|
||||
description: Option[String],
|
||||
isPrivate: Boolean,
|
||||
defaultBranch: String = "master",
|
||||
originRepositoryName: Option[String] = None,
|
||||
originUserName: Option[String] = None,
|
||||
parentRepositoryName: Option[String] = None,
|
||||
@@ -45,7 +46,7 @@ trait RepositoryService {
|
||||
repositoryName = repositoryName,
|
||||
isPrivate = isPrivate,
|
||||
description = description,
|
||||
defaultBranch = "master",
|
||||
defaultBranch = defaultBranch,
|
||||
registeredDate = currentDate,
|
||||
updatedDate = currentDate,
|
||||
lastActivityDate = currentDate,
|
||||
|
||||
Reference in New Issue
Block a user