diff --git a/models/action.go b/models/action.go index 5b6f0050e..fc1794dfd 100644 --- a/models/action.go +++ b/models/action.go @@ -470,13 +470,13 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err continue } - if err = issue.ChangeStatus(doer, repo, true); err != nil { - // Don't return an error when dependencies are open as this would let the push fail - if IsErrDependenciesLeft(err) { - return nil - } - return err + if err = issue.ChangeStatus(doer, repo, true); err != nil { + // Don't return an error when dependencies are open as this would let the push fail + if IsErrDependenciesLeft(err) { + return nil } + return err + } } // It is conflict to have close and reopen at same time, so refsMarked doesn't need to reinit here. diff --git a/models/error.go b/models/error.go index 1d0e66cf4..cf31bd5f4 100644 --- a/models/error.go +++ b/models/error.go @@ -1230,10 +1230,10 @@ func (err ErrCircularDependency) Error() string { // ErrDependenciesLeft represents an error where the issue you're trying to close still has dependencies left. type ErrDependenciesLeft struct { - IssueID int64 + IssueID int64 } -// IsErrCircularDependency checks if an error is a ErrCircularDependency. +// IsErrDependenciesLeft checks if an error is a ErrCircularDependency. func IsErrDependenciesLeft(err error) bool { _, ok := err.(ErrDependenciesLeft) return ok