aboutsummaryrefslogtreecommitdiffstats
path: root/modules/notification/base
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-01-19 23:26:57 +0000
committerGitHub <noreply@github.com>2022-01-19 23:26:57 +0000
commit5cb0c9aa0d7eed087055b1efca79628957207d36 (patch)
treed117a514e1f17e5f6bfcda1be273f6a971112663 /modules/notification/base
parent4563148a61ba892e8f2bb66342f00a950bcd5315 (diff)
downloadgitea-5cb0c9aa0d7eed087055b1efca79628957207d36.tar.gz
gitea-5cb0c9aa0d7eed087055b1efca79628957207d36.zip
Propagate context and ensure git commands run in request context (#17868)
This PR continues the work in #17125 by progressively ensuring that git commands run within the request context. This now means that the if there is a git repo already open in the context it will be used instead of reopening it. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules/notification/base')
-rw-r--r--modules/notification/base/notifier.go4
-rw-r--r--modules/notification/base/null.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/notification/base/notifier.go b/modules/notification/base/notifier.go
index 937476475a..177864994d 100644
--- a/modules/notification/base/notifier.go
+++ b/modules/notification/base/notifier.go
@@ -53,11 +53,11 @@ type Notifier interface {
NotifyDeleteRelease(doer *user_model.User, rel *models.Release)
NotifyPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits)
- NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string)
+ NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string)
NotifyDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string)
NotifySyncPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits)
- NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string)
+ NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string)
NotifySyncDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string)
NotifyRepoPendingTransfer(doer, newOwner *user_model.User, repo *repo_model.Repository)
diff --git a/modules/notification/base/null.go b/modules/notification/base/null.go
index e284c72b12..9524f02f1b 100644
--- a/modules/notification/base/null.go
+++ b/modules/notification/base/null.go
@@ -142,7 +142,7 @@ func (*NullNotifier) NotifyPushCommits(pusher *user_model.User, repo *repo_model
}
// NotifyCreateRef notifies branch or tag creation to notifiers
-func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
+func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string) {
}
// NotifyDeleteRef notifies branch or tag deletion to notifiers
@@ -162,7 +162,7 @@ func (*NullNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *repo_m
}
// NotifySyncCreateRef places a place holder function
-func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
+func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string) {
}
// NotifySyncDeleteRef places a place holder function