Remove incorrect "db.DefaultContext" usages (#35366)

This commit is contained in:
wxiaoguang
2025-08-28 11:52:43 +08:00
committed by GitHub
parent 7aef7ea2d4
commit 0cbaa0b662
256 changed files with 1951 additions and 2098 deletions

View File

@@ -22,7 +22,7 @@ func TestBlockUser(t *testing.T) {
defer tests.PrepareTestEnv(t)()
countStars := func(t *testing.T, repoOwnerID, starrerID int64) int64 {
count, err := db.Count[repo_model.Repository](db.DefaultContext, &repo_model.StarredReposOptions{
count, err := db.Count[repo_model.Repository](t.Context(), &repo_model.StarredReposOptions{
StarrerID: starrerID,
RepoOwnerID: repoOwnerID,
IncludePrivate: true,
@@ -32,7 +32,7 @@ func TestBlockUser(t *testing.T) {
}
countWatches := func(t *testing.T, repoOwnerID, watcherID int64) int64 {
count, err := db.Count[repo_model.Repository](db.DefaultContext, &repo_model.WatchedReposOptions{
count, err := db.Count[repo_model.Repository](t.Context(), &repo_model.WatchedReposOptions{
WatcherID: watcherID,
RepoOwnerID: repoOwnerID,
})
@@ -41,7 +41,7 @@ func TestBlockUser(t *testing.T) {
}
countRepositoryTransfers := func(t *testing.T, senderID, recipientID int64) int64 {
transfers, err := repo_model.GetPendingRepositoryTransfers(db.DefaultContext, &repo_model.PendingRepositoryTransferOptions{
transfers, err := repo_model.GetPendingRepositoryTransfers(t.Context(), &repo_model.PendingRepositoryTransferOptions{
SenderID: senderID,
RecipientID: recipientID,
})
@@ -50,7 +50,7 @@ func TestBlockUser(t *testing.T) {
}
countAssignedIssues := func(t *testing.T, repoOwnerID, assigneeID int64) int64 {
_, count, err := issues_model.GetAssignedIssues(db.DefaultContext, &issues_model.AssignedIssuesOptions{
_, count, err := issues_model.GetAssignedIssues(t.Context(), &issues_model.AssignedIssuesOptions{
AssigneeID: assigneeID,
RepoOwnerID: repoOwnerID,
})
@@ -59,7 +59,7 @@ func TestBlockUser(t *testing.T) {
}
countCollaborations := func(t *testing.T, repoOwnerID, collaboratorID int64) int64 {
count, err := db.Count[repo_model.Collaboration](db.DefaultContext, &repo_model.FindCollaborationOptions{
count, err := db.Count[repo_model.Collaboration](t.Context(), &repo_model.FindCollaborationOptions{
CollaboratorID: collaboratorID,
RepoOwnerID: repoOwnerID,
})