···176176177177 responsePushMirrors := make([]*api.PushMirror, 0, len(pushMirrors))
178178 for _, mirror := range pushMirrors {
179179- m, err := convert.ToPushMirror(mirror)
179179+ m, err := convert.ToPushMirror(ctx, mirror)
180180 if err == nil {
181181 responsePushMirrors = append(responsePushMirrors, m)
182182 }
···232232 ctx.Error(http.StatusNotFound, "GetPushMirrors", err)
233233 return
234234 }
235235- m, err := convert.ToPushMirror(pushMirror)
235235+ m, err := convert.ToPushMirror(ctx, pushMirror)
236236 if err != nil {
237237 ctx.ServerError("GetPushMirrorByRemoteName", err)
238238 return
···381381 ctx.ServerError("AddPushMirrorRemote", err)
382382 return
383383 }
384384- m, err := convert.ToPushMirror(pushMirror)
384384+ m, err := convert.ToPushMirror(ctx, pushMirror)
385385 if err != nil {
386386 ctx.ServerError("ToPushMirror", err)
387387 return
+1-1
routers/api/v1/repo/pull.go
···14421442 maxLines := setting.Git.MaxGitDiffLines
1443144314441444 // FIXME: If there are too many files in the repo, may cause some unpredictable issues.
14451445- diff, err := gitdiff.GetDiff(baseGitRepo,
14451445+ diff, err := gitdiff.GetDiff(ctx, baseGitRepo,
14461446 &gitdiff.DiffOptions{
14471447 BeforeCommitID: startCommitID,
14481448 AfterCommitID: endCommitID,
+1-1
routers/api/v1/repo/release_attachment.go
···200200 }
201201202202 // Create a new attachment and save the file
203203- attach, err := attachment.UploadAttachment(file, setting.Repository.Release.AllowedTypes, header.Size, &repo_model.Attachment{
203203+ attach, err := attachment.UploadAttachment(ctx, file, setting.Repository.Release.AllowedTypes, header.Size, &repo_model.Attachment{
204204 Name: filename,
205205 UploaderID: ctx.Doer.ID,
206206 RepoID: release.RepoID,
···6868 }
69697070 if newOwner.Type == user_model.UserTypeOrganization {
7171- if !ctx.Doer.IsAdmin && newOwner.Visibility == api.VisibleTypePrivate && !organization.OrgFromUser(newOwner).HasMemberWithUserID(ctx.Doer.ID) {
7171+ if !ctx.Doer.IsAdmin && newOwner.Visibility == api.VisibleTypePrivate && !organization.OrgFromUser(newOwner).HasMemberWithUserID(ctx, ctx.Doer.ID) {
7272 // The user shouldn't know about this organization
7373 ctx.Error(http.StatusNotFound, "", "The new owner does not exist or cannot be found")
7474 return
+1-1
routers/web/admin/notice.go
···2424 ctx.Data["Title"] = ctx.Tr("admin.notices")
2525 ctx.Data["PageIsAdminNotices"] = true
26262727- total := system_model.CountNotices()
2727+ total := system_model.CountNotices(ctx)
2828 page := ctx.FormInt("page")
2929 if page <= 1 {
3030 page = 1
···265265266266 // Check if user is allowed to create repo's on the organization.
267267 if ctxUser.IsOrganization() {
268268- isAllowedToFork, err := organization.OrgFromUser(ctxUser).CanCreateOrgRepo(ctx.Doer.ID)
268268+ isAllowedToFork, err := organization.OrgFromUser(ctxUser).CanCreateOrgRepo(ctx, ctx.Doer.ID)
269269 if err != nil {
270270 ctx.ServerError("CanCreateOrgRepo", err)
271271 return
···908908 // as the viewed information is designed to be loaded only on latest PR
909909 // diff and if you're signed in.
910910 if !ctx.IsSigned || willShowSpecifiedCommit || willShowSpecifiedCommitRange {
911911- diff, err = gitdiff.GetDiff(gitRepo, diffOptions, files...)
911911+ diff, err = gitdiff.GetDiff(ctx, gitRepo, diffOptions, files...)
912912 methodWithError = "GetDiff"
913913 } else {
914914 diff, err = gitdiff.SyncAndGetUserSpecificDiff(ctx, ctx.Doer.ID, pull, gitRepo, diffOptions, files...)
···189189 // An alternative option here would be write a function which would delete all organizations but it seems
190190 // but such a function would likely get out of date
191191 for {
192192- orgs, err := organization.FindOrgs(organization.FindOrgOptions{
192192+ orgs, err := organization.FindOrgs(ctx, organization.FindOrgOptions{
193193 ListOptions: db.ListOptions{
194194 PageSize: repo_model.RepositoryListDefaultPageSize,
195195 Page: 1,
+1-1
services/wiki/wiki.go
···350350351351// DeleteWiki removes the actual and local copy of repository wiki.
352352func DeleteWiki(ctx context.Context, repo *repo_model.Repository) error {
353353- if err := repo_model.UpdateRepositoryUnits(repo, nil, []unit.Type{unit.TypeWiki}); err != nil {
353353+ if err := repo_model.UpdateRepositoryUnits(ctx, repo, nil, []unit.Type{unit.TypeWiki}); err != nil {
354354 return err
355355 }
356356