aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/push.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-12-03 10:48:26 +0800
committerGitHub <noreply@github.com>2022-12-03 10:48:26 +0800
commit0a7d3ff786508284224ada17956a65bb759d9265 (patch)
tree4860fca95c1432ab59c6723ee2b053b1c7d6779d /services/repository/push.go
parent8698458f48eafeab21014db544aa7160368856e1 (diff)
downloadgitea-0a7d3ff786508284224ada17956a65bb759d9265.tar.gz
gitea-0a7d3ff786508284224ada17956a65bb759d9265.zip
refactor some functions to support ctx as first parameter (#21878)
Co-authored-by: KN4CK3R <admin@oldschoolhack.me> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'services/repository/push.go')
-rw-r--r--services/repository/push.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/repository/push.go b/services/repository/push.go
index bce01cb76a..f1eedb8e08 100644
--- a/services/repository/push.go
+++ b/services/repository/push.go
@@ -81,7 +81,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("PushUpdates: %s/%s", optsList[0].RepoUserName, optsList[0].RepoName))
defer finished()
- repo, err := repo_model.GetRepositoryByOwnerAndName(optsList[0].RepoUserName, optsList[0].RepoName)
+ repo, err := repo_model.GetRepositoryByOwnerAndName(ctx, optsList[0].RepoUserName, optsList[0].RepoName)
if err != nil {
return fmt.Errorf("GetRepositoryByOwnerAndName failed: %w", err)
}
@@ -109,7 +109,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
if opts.IsTag() { // If is tag reference
if pusher == nil || pusher.ID != opts.PusherID {
var err error
- if pusher, err = user_model.GetUserByID(opts.PusherID); err != nil {
+ if pusher, err = user_model.GetUserByID(ctx, opts.PusherID); err != nil {
return err
}
}
@@ -149,7 +149,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
} else if opts.IsBranch() { // If is branch reference
if pusher == nil || pusher.ID != opts.PusherID {
var err error
- if pusher, err = user_model.GetUserByID(opts.PusherID); err != nil {
+ if pusher, err = user_model.GetUserByID(ctx, opts.PusherID); err != nil {
return err
}
}