mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 09:21:15 +00:00
Move unit into models/unit/ (#17576)
* Move unit into models/unit/ * Rename unit.UnitType as unit.Type
This commit is contained in:
parent
b6b1e71665
commit
99b2858e62
68 changed files with 556 additions and 491 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/unit"
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
|
@ -139,13 +140,13 @@ func manuallyMerged(pr *models.PullRequest) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
if unit, err := pr.BaseRepo.GetUnit(models.UnitTypePullRequests); err == nil {
|
||||
if unit, err := pr.BaseRepo.GetUnit(unit.TypePullRequests); err == nil {
|
||||
config := unit.PullRequestsConfig()
|
||||
if !config.AutodetectManualMerge {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
log.Error("PullRequest[%d].BaseRepo.GetUnit(models.UnitTypePullRequests): %v", pr.ID, err)
|
||||
log.Error("PullRequest[%d].BaseRepo.GetUnit(unit.TypePullRequests): %v", pr.ID, err)
|
||||
return false
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue