Display pull request for mirror repo

This commit is contained in:
harryzcy 2022-07-16 04:36:03 -04:00
parent 5b1c73ecac
commit f627311ad7
No known key found for this signature in database
GPG Key ID: CC2953E050C19686
1 changed files with 2 additions and 2 deletions

View File

@ -516,12 +516,12 @@ func (repo *Repository) CanCreateBranch() bool {
// CanEnablePulls returns true if repository meets the requirements of accepting pulls.
func (repo *Repository) CanEnablePulls() bool {
return !repo.IsMirror && !repo.IsEmpty
return !repo.IsEmpty
}
// AllowsPulls returns true if repository meets the requirements of accepting pulls and has them enabled.
func (repo *Repository) AllowsPulls() bool {
return repo.CanEnablePulls() && repo.UnitEnabled(unit.TypePullRequests)
return repo.CanEnablePulls() && !repo.IsMirror && repo.UnitEnabled(unit.TypePullRequests)
}
// CanEnableEditor returns true if repository meets the requirements of web editor.