mirror of
https://github.com/gogs/gogs.git
synced 2026-05-07 03:37:36 +02:00
repo: fix issue of fork repository no check the limit of users' repository (#5346)
This commit is contained in:
@@ -2348,6 +2348,10 @@ func HasForkedRepo(ownerID, repoID int64) (*Repository, bool, error) {
|
||||
|
||||
// ForkRepository creates a fork of target repository under another user domain.
|
||||
func ForkRepository(doer, owner *User, baseRepo *Repository, name, desc string) (_ *Repository, err error) {
|
||||
if !owner.CanCreateRepo() {
|
||||
return nil, errors.ReachLimitOfRepo{owner.RepoCreationNum()}
|
||||
}
|
||||
|
||||
repo := &Repository{
|
||||
OwnerID: owner.ID,
|
||||
Owner: owner,
|
||||
|
||||
Reference in New Issue
Block a user