1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Mirror repository should not allow fork

This commit is contained in:
Unknwon
2015-09-05 14:31:52 -04:00
parent 46dce2d653
commit 119dec51f2
5 changed files with 9 additions and 6 deletions

View File

@@ -272,6 +272,11 @@ func (repo *Repository) IsOwnedBy(userID int64) bool {
return repo.OwnerID == userID
}
// CanBeForked returns true if repository meets the requirements of being forked.
func (repo *Repository) CanBeForked() bool {
return !repo.IsBare && !repo.IsMirror
}
func (repo *Repository) NextIssueIndex() int64 {
return int64(repo.NumIssues+repo.NumPulls) + 1
}