// use git_next_core::{ git::{ForgeLike, RepoDetails}, ForgeType, }; #[cfg(feature = "forgejo")] use git_next_forge_forgejo::ForgeJo; #[cfg(feature = "github")] use git_next_forge_github::Github; use kxio::network::Network; #[derive(Clone, Debug)] pub struct Forge; impl Forge { pub fn create(repo_details: RepoDetails, net: Network) -> Box { match repo_details.forge.forge_type() { #[cfg(feature = "forgejo")] ForgeType::ForgeJo => Box::new(ForgeJo::new(repo_details, net)), #[cfg(feature = "github")] ForgeType::GitHub => Box::new(Github::new(repo_details, net)), _ => unreachable!(), } } } #[cfg(test)] pub mod tests;