Don't attempt to close issue if already closed (#9699)

pull/9683/head^2
guillep2k 5 years ago committed by techknowlogick
parent a516a7ba0f
commit ff16099c6d
  1. 8
      modules/repofiles/action.go
  2. 6
      services/pull/merge.go

@ -137,9 +137,11 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*m
continue
}
}
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil {
return err
close := (ref.Action == references.XRefActionCloses)
if close != refIssue.IsClosed {
if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil {
return err
}
}
}
}

@ -374,8 +374,10 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
return err
}
close := (ref.RefAction == references.XRefActionCloses)
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
if close != ref.Issue.IsClosed {
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
}
}
}

Loading…
Cancel
Save