mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 19:06:18 +01:00 
			
		
		
		
	Move almost all functions' parameter db.Engine to context.Context (#19748)
* Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions
This commit is contained in:
		| @@ -18,6 +18,7 @@ import ( | ||||
| 	"time" | ||||
|  | ||||
| 	"code.gitea.io/gitea/models" | ||||
| 	"code.gitea.io/gitea/models/db" | ||||
| 	"code.gitea.io/gitea/models/perm" | ||||
| 	repo_model "code.gitea.io/gitea/models/repo" | ||||
| 	"code.gitea.io/gitea/models/unittest" | ||||
| @@ -438,7 +439,7 @@ func doProtectBranch(ctx APITestContext, branch, userToWhitelist, unprotectedFil | ||||
| 			}) | ||||
| 			ctx.Session.MakeRequest(t, req, http.StatusSeeOther) | ||||
| 		} else { | ||||
| 			user, err := user_model.GetUserByName(userToWhitelist) | ||||
| 			user, err := user_model.GetUserByName(db.DefaultContext, userToWhitelist) | ||||
| 			assert.NoError(t, err) | ||||
| 			// Change branch to protected | ||||
| 			req := NewRequestWithValues(t, "POST", fmt.Sprintf("/%s/%s/settings/branches/%s", url.PathEscape(ctx.Username), url.PathEscape(ctx.Reponame), url.PathEscape(branch)), map[string]string{ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user