git-next/crates/server/src/gitforge/mock_forge.rs
Paul Campbell 4d352f005d
All checks were successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
refactor(server,config,git): extract modules config and git from server
2024-05-12 10:49:33 +01:00

59 lines
1.4 KiB
Rust

use git_next_config::{BranchName, GitDir, RepoConfig};
use git_next_git::{self as git, GitRef, Repository};
use crate::{actors::repo::RepoActor, gitforge, types::MessageToken};
struct MockForge;
#[derive(Clone, Debug)]
pub struct MockForgeEnv;
impl MockForgeEnv {
pub(crate) const fn new() -> Self {
Self
}
}
#[async_trait::async_trait]
impl super::ForgeLike for MockForgeEnv {
fn name(&self) -> String {
"mock".to_string()
}
async fn branches_get_all(&self) -> Result<Vec<BranchName>, gitforge::ForgeBranchError> {
todo!()
}
async fn file_contents_get(
&self,
_branch: &BranchName,
_file_path: &str,
) -> Result<String, gitforge::ForgeFileError> {
todo!()
}
async fn branches_validate_positions(
&self,
_repository: Repository,
_repo_config: RepoConfig,
_addr: actix::prelude::Addr<RepoActor>,
_message_token: MessageToken,
) {
todo!()
}
fn branch_reset(
&self,
_repository: &Repository,
_branch_name: BranchName,
_to_commit: GitRef,
_force: git::reset::Force,
) -> git::reset::Result {
todo!()
}
async fn commit_status(&self, _commit: &git::Commit) -> gitforge::CommitStatus {
todo!()
}
fn repo_clone(&self, _gitdir: GitDir) -> Result<Repository, git::repository::Error> {
todo!()
}
}