"strings"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification/base"
"code.gitea.io/gitea/modules/repository"
}
}
-func (*actionNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
+func (*actionNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
if err := models.NotifyWatchers(&models.Action{
ActUserID: doer.ID,
ActUser: doer,
import (
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/repository"
)
addedLabels []*models.Label, removedLabels []*models.Label)
NotifyNewPullRequest(*models.PullRequest)
- NotifyMergePullRequest(*models.PullRequest, *models.User, *git.Repository)
+ NotifyMergePullRequest(*models.PullRequest, *models.User)
NotifyPullRequestSynchronized(doer *models.User, pr *models.PullRequest)
NotifyPullRequestReview(*models.PullRequest, *models.Review, *models.Comment)
NotifyPullRequestChangeTargetBranch(doer *models.User, pr *models.PullRequest, oldBranch string)
import (
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/repository"
)
}
// NotifyMergePullRequest places a place holder function
-func (*NullNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
+func (*NullNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
}
// NotifyPullRequestSynchronized places a place holder function
"fmt"
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification/base"
"code.gitea.io/gitea/services/mailer"
}
}
-func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
+func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
if err := pr.LoadIssue(); err != nil {
log.Error("pr.LoadIssue: %v", err)
return
import (
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/notification/action"
"code.gitea.io/gitea/modules/notification/base"
"code.gitea.io/gitea/modules/notification/indexer"
}
// NotifyMergePullRequest notifies merge pull request to notifiers
-func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repository) {
+func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
for _, notifier := range notifiers {
- notifier.NotifyMergePullRequest(pr, doer, baseGitRepo)
+ notifier.NotifyMergePullRequest(pr, doer)
}
}
import (
"code.gitea.io/gitea/models"
- "code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/notification/base"
)
}
}
-func (ns *notificationService) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, gitRepo *git.Repository) {
+func (ns *notificationService) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
ns.issueQueue <- issueNotificationOpts{
issueID: pr.Issue.ID,
notificationAuthorID: doer.ID,
}
}
-func (*webhookNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
+func (*webhookNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) {
// Reload pull request information.
if err := pr.LoadAttributes(); err != nil {
log.Error("LoadAttributes: %v", err)
return false
}
- baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath())
- if err != nil {
- log.Error("OpenRepository[%s] : %v", pr.BaseRepo.RepoPath(), err)
- return false
- }
-
- notification.NotifyMergePullRequest(pr, merger, baseGitRepo)
+ notification.NotifyMergePullRequest(pr, merger)
log.Info("manuallyMerged[%d]: Marked as manually merged into %s/%s by commit id: %s", pr.ID, pr.BaseRepo.Name, pr.BaseBranch, commit.ID.String())
return true
log.Error("setMerged [%d]: %v", pr.ID, err)
}
- notification.NotifyMergePullRequest(pr, doer, baseGitRepo)
+ notification.NotifyMergePullRequest(pr, doer)
// Reset cached commit count
cache.Remove(pr.Issue.Repo.GetCommitsCountCacheKey(pr.BaseBranch, true))