parent
c6b3c5bcef
commit
67b316a954
16 changed files with 144 additions and 45 deletions
|
@ -11,11 +11,11 @@ import (
|
|||
|
||||
// ChangeStatus changes issue status to open or closed.
|
||||
func ChangeStatus(issue *models.Issue, doer *models.User, isClosed bool) (err error) {
|
||||
err = issue.ChangeStatus(doer, isClosed)
|
||||
comment, err := issue.ChangeStatus(doer, isClosed)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
notification.NotifyIssueChangeStatus(doer, issue, isClosed)
|
||||
notification.NotifyIssueChangeStatus(doer, issue, comment, isClosed)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue