mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 18:58:38 +00:00
Some repository refactors (#17950)
* some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
This commit is contained in:
@@ -340,7 +340,7 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
|
||||
// "OwnForkRepo"
|
||||
var ownForkRepo *repo_model.Repository
|
||||
if ctx.User != nil && baseRepo.OwnerID != ctx.User.ID {
|
||||
repo := models.GetForkedRepo(ctx.User.ID, baseRepo.ID)
|
||||
repo := repo_model.GetForkedRepo(ctx.User.ID, baseRepo.ID)
|
||||
if repo != nil {
|
||||
ownForkRepo = repo
|
||||
ctx.Data["OwnForkRepo"] = ownForkRepo
|
||||
@@ -364,13 +364,13 @@ func ParseCompareInfo(ctx *context.Context) *CompareInfo {
|
||||
|
||||
// 5. If the headOwner has a fork of the baseRepo - use that
|
||||
if !has {
|
||||
ci.HeadRepo = models.GetForkedRepo(ci.HeadUser.ID, baseRepo.ID)
|
||||
ci.HeadRepo = repo_model.GetForkedRepo(ci.HeadUser.ID, baseRepo.ID)
|
||||
has = ci.HeadRepo != nil
|
||||
}
|
||||
|
||||
// 6. If the baseRepo is a fork and the headUser has a fork of that use that
|
||||
if !has && baseRepo.IsFork {
|
||||
ci.HeadRepo = models.GetForkedRepo(ci.HeadUser.ID, baseRepo.ForkID)
|
||||
ci.HeadRepo = repo_model.GetForkedRepo(ci.HeadUser.ID, baseRepo.ForkID)
|
||||
has = ci.HeadRepo != nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user