mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 18:04:14 +01:00
tmp: fix issue open count
This commit is contained in:
parent
d951824ff9
commit
5da306c0e5
2 changed files with 5 additions and 5 deletions
|
@ -903,16 +903,15 @@ func (pr *PullRequest) AfterSet(colName string, _ xorm.Cell) {
|
|||
}
|
||||
|
||||
// Merge merges pull request to base repository.
|
||||
func (pr *PullRequest) Merge(baseGitRepo *git.Repository) (err error) {
|
||||
func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error) {
|
||||
sess := x.NewSession()
|
||||
defer sessionRelease(sess)
|
||||
if err = sess.Begin(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pr.Pull.IsClosed = true
|
||||
if _, err = sess.Id(pr.Pull.ID).AllCols().Update(pr.Pull); err != nil {
|
||||
return fmt.Errorf("update pull: %v", err)
|
||||
if err = pr.Pull.changeStatus(sess, doer, true); err != nil {
|
||||
return fmt.Errorf("Pull.changeStatus: %v", err)
|
||||
}
|
||||
|
||||
headRepoPath := RepoPath(pr.HeadUserName, pr.HeadRepo.Name)
|
||||
|
|
|
@ -381,7 +381,8 @@ func MergePullRequest(ctx *middleware.Context) {
|
|||
}
|
||||
|
||||
pr.Pull = pull
|
||||
if err = pr.Merge(ctx.Repo.GitRepo); err != nil {
|
||||
pr.Pull.Repo = ctx.Repo.Repository
|
||||
if err = pr.Merge(ctx.User, ctx.Repo.GitRepo); err != nil {
|
||||
ctx.Handle(500, "GetPullRequestByPullID", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue