mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-20 21:18:00 +02:00
Refactor the fork service slightly to take ForkRepoOptions (#16744)
* Refactor the fork service slightly to take ForkRepoOptions This reduces the number of places we need to change if we want to add other options during fork time. Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * Fix integrations and tests after ForkRepository refactor Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * Update OldRepo -> BaseRepo Signed-off-by: Kyle Evans <kevans@FreeBSD.org> * gofmt pass Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
This commit is contained in:
@ -1004,6 +1004,13 @@ type CreateRepoOptions struct {
|
||||
MirrorInterval string
|
||||
}
|
||||
|
||||
// ForkRepoOptions contains the fork repository options
|
||||
type ForkRepoOptions struct {
|
||||
BaseRepo *Repository
|
||||
Name string
|
||||
Description string
|
||||
}
|
||||
|
||||
// GetRepoInitFile returns repository init files
|
||||
func GetRepoInitFile(tp, name string) ([]byte, error) {
|
||||
cleanedName := strings.TrimLeft(path.Clean("/"+name), "/")
|
||||
|
Reference in New Issue
Block a user