1
0
Fork 0
forked from forgejo/forgejo

Move transfer repository and rename repository on a service package and start action notification (#8573)

* move transfer repository and rename repository on a service package and start action notification

* remove unused codes

* fix lint

* fix bugs

* fix test

* fix test

* fix test

* fix lint

* update go mod and sum
This commit is contained in:
Lunny Xiao 2019-11-15 16:06:11 +08:00 committed by GitHub
parent b30d744e09
commit 21ae9838e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 216 additions and 253 deletions

View file

@ -424,8 +424,16 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
log.Error("setMerged [%d]: %v", pr.ID, err)
}
if err = models.MergePullRequestAction(doer, pr.Issue.Repo, pr.Issue); err != nil {
log.Error("MergePullRequestAction [%d]: %v", pr.ID, err)
if err := models.NotifyWatchers(&models.Action{
ActUserID: doer.ID,
ActUser: doer,
OpType: models.ActionMergePullRequest,
Content: fmt.Sprintf("%d|%s", pr.Issue.Index, pr.Issue.Title),
RepoID: pr.Issue.Repo.ID,
Repo: pr.Issue.Repo,
IsPrivate: pr.Issue.Repo.IsPrivate,
}); err != nil {
log.Error("NotifyWatchers [%d]: %v", pr.ID, err)
}
// Reset cached commit count