repo: fix issue of fork repository no check the limit of users' repository (#5346)

This commit is contained in:
GeekComb
2018-07-18 20:03:09 +08:00
committed by 无闻
parent 97fb9d283f
commit c9bb33afc3
2 changed files with 6 additions and 0 deletions

View File

@@ -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,