mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-23 02:18:30 +00:00
Remove incorrect "db.DefaultContext" usages (#35366)
This commit is contained in:
@@ -137,7 +137,7 @@ func testGitPush(t *testing.T, u *url.URL) {
|
||||
|
||||
func runTestGitPush(t *testing.T, u *url.URL, gitOperation func(t *testing.T, gitPath string) (pushed, deleted []string)) {
|
||||
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 2})
|
||||
repo, err := repo_service.CreateRepository(db.DefaultContext, user, user, repo_service.CreateRepoOptions{
|
||||
repo, err := repo_service.CreateRepository(t.Context(), user, user, repo_service.CreateRepoOptions{
|
||||
Name: "repo-to-push",
|
||||
Description: "test git push",
|
||||
AutoInit: false,
|
||||
@@ -169,7 +169,7 @@ func runTestGitPush(t *testing.T, u *url.URL, gitOperation func(t *testing.T, gi
|
||||
pushedBranches, deletedBranches := gitOperation(t, gitPath)
|
||||
|
||||
dbBranches := make([]*git_model.Branch, 0)
|
||||
require.NoError(t, db.GetEngine(db.DefaultContext).Where("repo_id=?", repo.ID).Find(&dbBranches))
|
||||
require.NoError(t, db.GetEngine(t.Context()).Where("repo_id=?", repo.ID).Find(&dbBranches))
|
||||
assert.Lenf(t, dbBranches, len(pushedBranches), "mismatched number of branches in db")
|
||||
dbBranchesMap := make(map[string]*git_model.Branch, len(dbBranches))
|
||||
for _, branch := range dbBranches {
|
||||
@@ -191,7 +191,7 @@ func runTestGitPush(t *testing.T, u *url.URL, gitOperation func(t *testing.T, gi
|
||||
assert.Equal(t, commitID, branch.CommitID)
|
||||
}
|
||||
|
||||
require.NoError(t, repo_service.DeleteRepositoryDirectly(db.DefaultContext, repo.ID))
|
||||
require.NoError(t, repo_service.DeleteRepositoryDirectly(t.Context(), repo.ID))
|
||||
}
|
||||
|
||||
func TestPushPullRefs(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user