|
|
@ -24,6 +24,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/notification" |
|
|
|
"code.gitea.io/gitea/modules/notification" |
|
|
|
"code.gitea.io/gitea/modules/repofiles" |
|
|
|
"code.gitea.io/gitea/modules/repofiles" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/structs" |
|
|
|
"code.gitea.io/gitea/modules/util" |
|
|
|
"code.gitea.io/gitea/modules/util" |
|
|
|
"code.gitea.io/gitea/routers/utils" |
|
|
|
"code.gitea.io/gitea/routers/utils" |
|
|
|
"code.gitea.io/gitea/services/gitdiff" |
|
|
|
"code.gitea.io/gitea/services/gitdiff" |
|
|
@ -95,15 +96,16 @@ func getForkRepository(ctx *context.Context) *models.Repository { |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["repo_name"] = forkRepo.Name |
|
|
|
|
|
|
|
ctx.Data["description"] = forkRepo.Description |
|
|
|
|
|
|
|
ctx.Data["IsPrivate"] = forkRepo.IsPrivate |
|
|
|
|
|
|
|
canForkToUser := forkRepo.OwnerID != ctx.User.ID && !ctx.User.HasForkedRepo(forkRepo.ID) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if err := forkRepo.GetOwner(); err != nil { |
|
|
|
if err := forkRepo.GetOwner(); err != nil { |
|
|
|
ctx.ServerError("GetOwner", err) |
|
|
|
ctx.ServerError("GetOwner", err) |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["repo_name"] = forkRepo.Name |
|
|
|
|
|
|
|
ctx.Data["description"] = forkRepo.Description |
|
|
|
|
|
|
|
ctx.Data["IsPrivate"] = forkRepo.IsPrivate || forkRepo.Owner.Visibility == structs.VisibleTypePrivate |
|
|
|
|
|
|
|
canForkToUser := forkRepo.OwnerID != ctx.User.ID && !ctx.User.HasForkedRepo(forkRepo.ID) |
|
|
|
|
|
|
|
|
|
|
|
ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name |
|
|
|
ctx.Data["ForkFrom"] = forkRepo.Owner.Name + "/" + forkRepo.Name |
|
|
|
ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID |
|
|
|
ctx.Data["ForkFromOwnerID"] = forkRepo.Owner.ID |
|
|
|
|
|
|
|
|
|
|
|