diff options
author | Kyle Evans <kevans91@users.noreply.github.com> | 2021-08-28 03:37:14 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 16:37:14 +0800 |
commit | cad70599a65894651d91ad230b57857a443a4d26 (patch) | |
tree | 81181d7a44f8dd3f15234ca4ec28b03f1ff4187b /models/repo.go | |
parent | 19049413827b130809ffe249900a5c89ef8a90df (diff) | |
download | gitea-cad70599a65894651d91ad230b57857a443a4d26.tar.gz gitea-cad70599a65894651d91ad230b57857a443a4d26.zip |
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>
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/models/repo.go b/models/repo.go index f2e3f5b58b..c3f93f3562 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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), "/") |