diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-12-16 05:57:34 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-12-15 16:57:34 -0500 |
commit | 67b316a954b161cac27e16b6455837881919dd94 (patch) | |
tree | 46e0278f556447cd9228d63c49a32dacea1f3352 /services/pull | |
parent | c6b3c5bcefde6be4c64f5769a38962c2ce6ad6de (diff) | |
download | gitea-67b316a954b161cac27e16b6455837881919dd94.tar.gz gitea-67b316a954b161cac27e16b6455837881919dd94.zip |
Refactor comment (#9330)
* Refactor comment
* fix test
* improve code
Diffstat (limited to 'services/pull')
-rw-r--r-- | services/pull/check.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/pull/check.go b/services/pull/check.go index 7344f071ac..db25361b6d 100644 --- a/services/pull/check.go +++ b/services/pull/check.go @@ -19,6 +19,7 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/graceful" "code.gitea.io/gitea/modules/log" + "code.gitea.io/gitea/modules/notification" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/sync" "code.gitea.io/gitea/modules/timeutil" @@ -145,6 +146,15 @@ func manuallyMerged(pr *models.PullRequest) bool { log.Error("PullRequest[%d].setMerged : %v", pr.ID, 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) + 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 } |