diff --git a/models/action.go b/models/action.go index 8793a4a24..b1ccfe074 100644 --- a/models/action.go +++ b/models/action.go @@ -472,8 +472,13 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err continue } - if err = issue.ChangeStatus(doer, repo, true); err != nil { - return err + // 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 { + return err + } } }