git_hosting_providers: Refactor constructors (#26919)

This PR refactors the constructors for the various Git hosting providers
to facilitate adding support for more self-hosted variants.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-03-17 09:46:58 -04:00 committed by GitHub
parent 8ba6ce43ac
commit 45606abfdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 65 additions and 40 deletions

View file

@ -14,12 +14,12 @@ pub use crate::providers::*;
/// Initializes the Git hosting providers.
pub fn init(cx: &App) {
let provider_registry = GitHostingProviderRegistry::global(cx);
provider_registry.register_hosting_provider(Arc::new(Bitbucket));
provider_registry.register_hosting_provider(Arc::new(Bitbucket::public_instance()));
provider_registry.register_hosting_provider(Arc::new(Chromium));
provider_registry.register_hosting_provider(Arc::new(Codeberg));
provider_registry.register_hosting_provider(Arc::new(Gitee));
provider_registry.register_hosting_provider(Arc::new(Github::new()));
provider_registry.register_hosting_provider(Arc::new(Gitlab::new()));
provider_registry.register_hosting_provider(Arc::new(Github::public_instance()));
provider_registry.register_hosting_provider(Arc::new(Gitlab::public_instance()));
provider_registry.register_hosting_provider(Arc::new(Sourcehut));
}