git-next/crates/forge/src/mock_forge.rs

45 lines
947 B
Rust
Raw Normal View History

//
#![cfg(not(tarpaulin_include))]
use git::OpenRepository;
2024-05-23 16:50:36 +01:00
use git_next_config as config;
use git_next_git as git;
struct MockForge;
#[derive(Clone, Debug)]
pub struct MockForgeEnv;
impl MockForgeEnv {
pub(crate) const fn new() -> Self {
Self
}
}
#[async_trait::async_trait]
2024-05-23 16:50:36 +01:00
impl git::ForgeLike for MockForgeEnv {
fn name(&self) -> String {
"mock".to_string()
}
2024-05-23 16:50:36 +01:00
async fn branches_get_all(&self) -> Result<Vec<config::BranchName>, git::branch::Error> {
todo!()
}
async fn file_contents_get(
&self,
2024-05-23 16:50:36 +01:00
_branch: &config::BranchName,
_file_path: &str,
2024-05-23 16:50:36 +01:00
) -> Result<String, git::file::Error> {
todo!()
}
async fn commit_status(&self, _commit: &git::Commit) -> git::commit::Status {
todo!()
}
2024-05-23 16:50:36 +01:00
fn repo_clone(
&self,
_gitdir: config::GitDir,
) -> Result<OpenRepository, git::repository::Error> {
todo!()
}
}