From 61fc5c514a6b3f99560b0df5e4cdb7df94763984 Mon Sep 17 00:00:00 2001 From: Earl Warren Date: Tue, 5 Dec 2023 17:15:17 +0100 Subject: [PATCH] [FEAT] add Forgejo Git Service (squash) register a Forgejo factory If the Forgejo factory for the Forgejo service is not registered, newDownloader will fallback to a git service and not migrate issues etc. Refs: https://codeberg.org/forgejo/forgejo/issues/1678 (cherry picked from commit 2ecb2558be696965a49b543d5e843526c105e07a) Do not include tests so it is kept minimal. --- services/migrations/forgejo_downloader.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 services/migrations/forgejo_downloader.go diff --git a/services/migrations/forgejo_downloader.go b/services/migrations/forgejo_downloader.go new file mode 100644 index 0000000000..25dbb6ec51 --- /dev/null +++ b/services/migrations/forgejo_downloader.go @@ -0,0 +1,20 @@ +// Copyright 2023 The Forgejo Authors +// SPDX-License-Identifier: MIT + +package migrations + +import ( + "code.gitea.io/gitea/modules/structs" +) + +func init() { + RegisterDownloaderFactory(&ForgejoDownloaderFactory{}) +} + +type ForgejoDownloaderFactory struct { + GiteaDownloaderFactory +} + +func (f *ForgejoDownloaderFactory) GitServiceType() structs.GitServiceType { + return structs.ForgejoService +}