summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/user.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 5aaf630f4a..18dce976f6 100644
--- a/models/user.go
+++ b/models/user.go
@@ -109,6 +109,12 @@ func (u *User) AfterSet(colName string, _ xorm.Cell) {
}
}
+// HasForkedRepo checks if user has already forked a repository with given ID.
+func (u *User) HasForkedRepo(repoID int64) bool {
+ _, has := HasForkedRepo(u.Id, repoID)
+ return has
+}
+
// CanEditGitHook returns true if user can edit Git hooks.
func (u *User) CanEditGitHook() bool {
return u.IsAdmin || u.AllowGitHook