summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-05 14:31:52 -0400
committerUnknwon <u@gogs.io>2015-09-05 14:31:52 -0400
commit119dec51f2ed764d004d32a5fc3006870d81291f (patch)
treea5ffceb9f4e12ef348dad58d7463d1f6726bdaed /models/repo.go
parent46dce2d65311fa37f04acfb4516b0dcb8cfbde5c (diff)
downloadgitea-119dec51f2ed764d004d32a5fc3006870d81291f.tar.gz
gitea-119dec51f2ed764d004d32a5fc3006870d81291f.zip
Mirror repository should not allow fork
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go5
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
}