diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-24 17:49:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 17:49:20 +0800 |
commit | a666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch) | |
tree | 9ab1434b759a8a2cb275a83149903a823851e309 /services/repository/files/update.go | |
parent | 4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff) | |
download | gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip |
Move user related model into models/user (#17781)
* Move user related model into models/user
* Fix lint for windows
* Fix windows lint
* Fix windows lint
* Move some tests in models
* Merge
Diffstat (limited to 'services/repository/files/update.go')
-rw-r--r-- | services/repository/files/update.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/repository/files/update.go b/services/repository/files/update.go index 5d6c3da670..eeb98f3630 100644 --- a/services/repository/files/update.go +++ b/services/repository/files/update.go @@ -12,6 +12,7 @@ import ( "time" "code.gitea.io/gitea/models" + user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/charset" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/lfs" @@ -122,7 +123,7 @@ func detectEncodingAndBOM(entry *git.TreeEntry, repo *models.Repository) (string } // CreateOrUpdateRepoFile adds or updates a file in the given repository -func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *UpdateRepoFileOptions) (*structs.FileResponse, error) { +func CreateOrUpdateRepoFile(repo *models.Repository, doer *user_model.User, opts *UpdateRepoFileOptions) (*structs.FileResponse, error) { // If no branch name is set, assume default branch if opts.OldBranch == "" { opts.OldBranch = repo.DefaultBranch @@ -439,7 +440,7 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up } // VerifyBranchProtection verify the branch protection for modifying the given treePath on the given branch -func VerifyBranchProtection(repo *models.Repository, doer *models.User, branchName string, treePath string) error { +func VerifyBranchProtection(repo *models.Repository, doer *user_model.User, branchName string, treePath string) error { protectedBranch, err := repo.GetBranchProtection(branchName) if err != nil { return err |