mirror of https://github.com/gogs/gogs.git
repo: does not allow fork to original owner (#4182)
But can still fork to organizations.pull/3853/merge
parent
c64b842df9
commit
4d90527a6e
|
@ -688,6 +688,7 @@ settings.tracker_issue_style.alphanumeric = Alphanumeric
|
|||
settings.tracker_url_format_desc = You can use placeholder <code>{user} {repo} {index}</code> for user name, repository name and issue index.
|
||||
settings.pulls_desc = Enable pull requests to accept public contributions
|
||||
settings.danger_zone = Danger Zone
|
||||
settings.cannot_fork_to_same_owner = You cannot fork a repository to its original owner.
|
||||
settings.new_owner_has_same_repo = The new owner already has a repository with same name. Please choose another name.
|
||||
settings.convert = Convert To Regular Repository
|
||||
settings.convert_desc = You can convert this mirror to a regular repository. This cannot be reversed.
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -118,6 +118,12 @@ func ForkPost(ctx *context.Context, form auth.CreateRepoForm) {
|
|||
}
|
||||
}
|
||||
|
||||
// Cannot fork to same owner
|
||||
if ctxUser.ID == forkRepo.OwnerID {
|
||||
ctx.RenderWithErr(ctx.Tr("repo.settings.cannot_fork_to_same_owner"), FORK, &form)
|
||||
return
|
||||
}
|
||||
|
||||
repo, err := models.ForkRepository(ctxUser, forkRepo, form.RepoName, form.Description)
|
||||
if err != nil {
|
||||
ctx.Data["Err_RepoName"] = true
|
||||
|
|
Loading…
Reference in New Issue