mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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") | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Lunny Xiao
					Lunny Xiao