summaryrefslogtreecommitdiffstats
path: root/integrations/api_repo_file_helpers.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-24 17:49:20 +0800
committerGitHub <noreply@github.com>2021-11-24 17:49:20 +0800
commita666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch)
tree9ab1434b759a8a2cb275a83149903a823851e309 /integrations/api_repo_file_helpers.go
parent4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff)
downloadgitea-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 'integrations/api_repo_file_helpers.go')
-rw-r--r--integrations/api_repo_file_helpers.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/integrations/api_repo_file_helpers.go b/integrations/api_repo_file_helpers.go
index ef3b8c610b..8477d65a3e 100644
--- a/integrations/api_repo_file_helpers.go
+++ b/integrations/api_repo_file_helpers.go
@@ -6,11 +6,12 @@ package integrations
import (
"code.gitea.io/gitea/models"
+ user_model "code.gitea.io/gitea/models/user"
api "code.gitea.io/gitea/modules/structs"
files_service "code.gitea.io/gitea/services/repository/files"
)
-func createFileInBranch(user *models.User, repo *models.Repository, treePath, branchName, content string) (*api.FileResponse, error) {
+func createFileInBranch(user *user_model.User, repo *models.Repository, treePath, branchName, content string) (*api.FileResponse, error) {
opts := &files_service.UpdateRepoFileOptions{
OldBranch: branchName,
TreePath: treePath,
@@ -22,6 +23,6 @@ func createFileInBranch(user *models.User, repo *models.Repository, treePath, br
return files_service.CreateOrUpdateRepoFile(repo, user, opts)
}
-func createFile(user *models.User, repo *models.Repository, treePath string) (*api.FileResponse, error) {
+func createFile(user *user_model.User, repo *models.Repository, treePath string) (*api.FileResponse, error) {
return createFileInBranch(user, repo, treePath, repo.DefaultBranch, "This is a NEW file")
}