mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
Source files keep their SPDX-License-Identifier and Hanzo copyright line; the Gitea, Gogs and LFS Test Server copyrights they used to repeat now live once in NOTICE, alongside LICENSE. The header lint accepts any copyright line above the SPDX line, so it no longer demands an upstream one. Co-authored-by: Hanzo Dev <[email protected]>
32 lines
908 B
Go
32 lines
908 B
Go
// Copyright 2026 Hanzo AI, Inc. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package repo
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/hanzoai/git/modules/templates"
|
|
"github.com/hanzoai/git/services/context"
|
|
repo_service "github.com/hanzoai/git/services/repository"
|
|
)
|
|
|
|
const tplEditorFork templates.TplName = "repo/editor/fork"
|
|
|
|
func ForkToEdit(ctx *context.Context) {
|
|
ctx.HTML(http.StatusOK, tplEditorFork)
|
|
}
|
|
|
|
func ForkToEditPost(ctx *context.Context) {
|
|
ForkRepoTo(ctx, ctx.Doer, repo_service.ForkRepoOptions{
|
|
BaseRepo: ctx.Repo.Repository,
|
|
Name: getUniqueRepositoryName(ctx, ctx.Doer.ID, ctx.Repo.Repository.Name),
|
|
Description: ctx.Repo.Repository.Description,
|
|
SingleBranch: ctx.Repo.Repository.DefaultBranch, // maybe we only need the default branch in the fork?
|
|
})
|
|
if ctx.Written() {
|
|
return
|
|
}
|
|
ctx.JSONRedirect("") // reload the page, the new fork should be editable now
|
|
}
|