[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.
This commit is contained in:
Earl Warren 2023-12-05 17:15:17 +01:00
parent 69221d84cf
commit 61fc5c514a
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -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
}