Don't attempt to close issue if already closed (#9699)

This commit is contained in:
guillep2k 2020-01-11 03:42:11 -03:00 committed by techknowlogick
parent a516a7ba0f
commit ff16099c6d
2 changed files with 9 additions and 5 deletions

View File

@ -137,9 +137,11 @@ func UpdateIssuesCommit(doer *models.User, repo *models.Repository, commits []*m
continue continue
} }
} }
close := (ref.Action == references.XRefActionCloses)
if err := changeIssueStatus(refRepo, refIssue, doer, ref.Action == references.XRefActionCloses); err != nil { if close != refIssue.IsClosed {
return err if err := changeIssueStatus(refRepo, refIssue, doer, close); err != nil {
return err
}
} }
} }
} }

View File

@ -374,8 +374,10 @@ func Merge(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repositor
return err return err
} }
close := (ref.RefAction == references.XRefActionCloses) close := (ref.RefAction == references.XRefActionCloses)
if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil { if close != ref.Issue.IsClosed {
return err if err = issue_service.ChangeStatus(ref.Issue, doer, close); err != nil {
return err
}
} }
} }