Implemented not closing an issue via commit message if it has blocking dependencies

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-08-29 20:40:00 +02:00 committed by Jonas Franz
parent c3a0581243
commit 21f36f99c6

View File

@ -472,10 +472,15 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err
continue continue
} }
// Check for dependencies, if there aren't any, close it
canbeClosed := IssueNoDependenciesLeft(issue.ID)
if canbeClosed {
if err = issue.ChangeStatus(doer, repo, true); err != nil { if err = issue.ChangeStatus(doer, repo, true); err != nil {
return err return err
} }
} }
}
// It is conflict to have close and reopen at same time, so refsMarked doesn't need to reinit here. // It is conflict to have close and reopen at same time, so refsMarked doesn't need to reinit here.
for _, ref := range issueReopenKeywordsPat.FindAllString(c.Message, -1) { for _, ref := range issueReopenKeywordsPat.FindAllString(c.Message, -1) {