Restore propagation of ErrDependenciesLeft (#18325)

Unfortunately #17643 prevented all propagation of ErrDependenciesLeft meaning
that dependency errors that prevent closing of issues get swallowed.

This PR restores propagation of the error but instead swallows the error in the
places where it needs to be swallowed.

Fix #18223

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath authored and GitHub committed 2022-01-19 00:26:42 +01:00
1 parent 84f8ef3df6
commit 4a20eadfd7
3 files changed
+9 -6

No files matched your search

+4 -1
View File
@@ -105,7 +105,10 @@ func Merge(pr *models.PullRequest, doer *user_model.User, baseGitRepo *git.Repos
close := ref.RefAction == references.XRefActionCloses
if close != ref.Issue.IsClosed {
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
// Allow ErrDependenciesLeft
if !models.IsErrDependenciesLeft(err) {
return err
}
}
}
}