From 21f36f99c60b77053e76451e4229cc43623bea95 Mon Sep 17 00:00:00 2001 From: Konrad Langenberg Date: Tue, 29 Aug 2017 20:40:00 +0200 Subject: [PATCH] Implemented not closing an issue via commit message if it has blocking dependencies Signed-off-by: Konrad --- models/action.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 + } } }