diff options
author | Unknwon <u@gogs.io> | 2015-09-05 14:31:52 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-05 14:31:52 -0400 |
commit | 119dec51f2ed764d004d32a5fc3006870d81291f (patch) | |
tree | a5ffceb9f4e12ef348dad58d7463d1f6726bdaed /models/repo.go | |
parent | 46dce2d65311fa37f04acfb4516b0dcb8cfbde5c (diff) | |
download | gitea-119dec51f2ed764d004d32a5fc3006870d81291f.tar.gz gitea-119dec51f2ed764d004d32a5fc3006870d81291f.zip |
Mirror repository should not allow fork
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go index 9fb5607db7..d0fa7c8fc6 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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 } |