diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-06-12 23:51:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 23:51:54 +0800 |
commit | 110fc57cbcf293c19ed7017d8ea528b4bbbd7396 (patch) | |
tree | b36eb2ee0e3f8417a35ad095e25880b778ded0ba /models/user.go | |
parent | a9dc9b06e4a4106ec8315fe7b2922efa440ca199 (diff) | |
download | gitea-110fc57cbcf293c19ed7017d8ea528b4bbbd7396.tar.gz gitea-110fc57cbcf293c19ed7017d8ea528b4bbbd7396.zip |
Move some code into models/git (#19879)
* Move access and repo permission to models/perm/access
* fix test
* Move some git related files into sub package models/git
* Fix build
* fix git test
* move lfs to sub package
* move more git related functions to models/git
* Move functions sequence
* Some improvements per @KN4CK3R and @delvh
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/models/user.go b/models/user.go index e8a412ca29..59ec643d55 100644 --- a/models/user.go +++ b/models/user.go @@ -15,6 +15,7 @@ import ( asymkey_model "code.gitea.io/gitea/models/asymkey" auth_model "code.gitea.io/gitea/models/auth" "code.gitea.io/gitea/models/db" + git_model "code.gitea.io/gitea/models/git" "code.gitea.io/gitea/models/issues" "code.gitea.io/gitea/models/organization" access_model "code.gitea.io/gitea/models/perm/access" @@ -125,7 +126,7 @@ func DeleteUser(ctx context.Context, u *user_model.User) (err error) { { const batchSize = 50 for start := 0; ; start += batchSize { - protections := make([]*ProtectedBranch, 0, batchSize) + protections := make([]*git_model.ProtectedBranch, 0, batchSize) // @perf: We can't filter on DB side by u.ID, as those IDs are serialized as JSON strings. // We could filter down with `WHERE repo_id IN (reposWithPushPermission(u))`, // though that query will be quite complex and tricky to maintain (compare `getRepoAssignees()`). |