mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-30 20:42:54 +09:00
Remove wrong "git.DefaultContext" (#35364)
Some checks failed
Some checks failed
This commit is contained in:
@ -4,16 +4,17 @@
|
||||
package integration
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
|
||||
repo_model "code.gitea.io/gitea/models/repo"
|
||||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
files_service "code.gitea.io/gitea/services/repository/files"
|
||||
)
|
||||
|
||||
func createFileInBranch(user *user_model.User, repo *repo_model.Repository, treePath, branchName, content string) (*api.FilesResponse, error) {
|
||||
ctx := context.TODO()
|
||||
opts := &files_service.ChangeRepoFilesOptions{
|
||||
Files: []*files_service.ChangeRepoFile{
|
||||
{
|
||||
@ -26,10 +27,11 @@ func createFileInBranch(user *user_model.User, repo *repo_model.Repository, tree
|
||||
Author: nil,
|
||||
Committer: nil,
|
||||
}
|
||||
return files_service.ChangeRepoFiles(git.DefaultContext, repo, user, opts)
|
||||
return files_service.ChangeRepoFiles(ctx, repo, user, opts)
|
||||
}
|
||||
|
||||
func deleteFileInBranch(user *user_model.User, repo *repo_model.Repository, treePath, branchName string) (*api.FilesResponse, error) {
|
||||
ctx := context.TODO()
|
||||
opts := &files_service.ChangeRepoFilesOptions{
|
||||
Files: []*files_service.ChangeRepoFile{
|
||||
{
|
||||
@ -41,7 +43,7 @@ func deleteFileInBranch(user *user_model.User, repo *repo_model.Repository, tree
|
||||
Author: nil,
|
||||
Committer: nil,
|
||||
}
|
||||
return files_service.ChangeRepoFiles(git.DefaultContext, repo, user, opts)
|
||||
return files_service.ChangeRepoFiles(ctx, repo, user, opts)
|
||||
}
|
||||
|
||||
func createOrReplaceFileInBranch(user *user_model.User, repo *repo_model.Repository, treePath, branchName, content string) error {
|
||||
|
Reference in New Issue
Block a user